Commit b5f83096 authored by Nikolai Kosjar's avatar Nikolai Kosjar

CppTools: Use CppCodeModelInspector::Dumper

...if dumping from updateProjectInfo().

Change-Id: I0db5f29605e5cae30e339f246fe2b67e5949fb2d
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent 4b99d218
......@@ -31,6 +31,7 @@
#include "abstracteditorsupport.h"
#include "builtinindexingsupport.h"
#include "cppcodemodelinspectordumper.h"
#include "cppcodemodelsettings.h"
#include "cppfindreferences.h"
#include "cpphighlightingsupport.h"
......@@ -404,63 +405,19 @@ QByteArray CppModelManager::internalDefinedMacros() const
return macros;
}
/// This function will acquire the mutex!
/// This function will acquire mutexes!
void CppModelManager::dumpModelManagerConfiguration()
{
// Tons of debug output...
qDebug() << "========= CppModelManager::dumpModelManagerConfiguration ======";
foreach (const ProjectInfo &pinfo, m_projectToProjectsInfo) {
qDebug() << " for project:"<< pinfo.project().data()->projectFilePath();
foreach (const ProjectPart::Ptr &part, pinfo.projectParts()) {
qDebug() << "=== part ===";
const char* cVersion;
switch (part->cVersion) {
case ProjectPart::C89: cVersion = "C89"; break;
case ProjectPart::C99: cVersion = "C99"; break;
case ProjectPart::C11: cVersion = "C11"; break;
default: cVersion = "INVALID";
}
const char* cxxVersion;
switch (part->cxxVersion) {
case ProjectPart::CXX98: cxxVersion = "CXX98"; break;
case ProjectPart::CXX11: cxxVersion = "CXX11"; break;
default: cxxVersion = "INVALID";
}
QStringList cxxExtensions;
if (part->cxxExtensions & ProjectPart::GnuExtensions)
cxxExtensions << QLatin1String("GnuExtensions");
if (part->cxxExtensions & ProjectPart::MicrosoftExtensions)
cxxExtensions << QLatin1String("MicrosoftExtensions");
if (part->cxxExtensions & ProjectPart::BorlandExtensions)
cxxExtensions << QLatin1String("BorlandExtensions");
if (part->cxxExtensions & ProjectPart::OpenMPExtensions)
cxxExtensions << QLatin1String("OpenMP");
qDebug() << "cVersion:" << cVersion;
qDebug() << "cxxVersion:" << cxxVersion;
qDebug() << "cxxExtensions:" << cxxExtensions;
qDebug() << "Qt version:" << part->qtVersion;
qDebug() << "project config file:" << part->projectConfigFile;
qDebug() << "precompiled header:" << part->precompiledHeaders;
qDebug() << "toolchain defines:" << part->toolchainDefines;
qDebug() << "project defines:" << part->projectDefines;
qDebug() << "includes:" << part->includePaths;
qDebug() << "frameworkPaths:" << part->frameworkPaths;
qDebug() << "files:" << part->files;
qDebug() << "";
}
}
const Snapshot globalSnapshot = snapshot();
const QString globalSnapshotTitle
= QString::fromLatin1("Global/Indexing Snapshot (%1 Documents)").arg(globalSnapshot.size());
CppCodeModelInspector::Dumper dumper(globalSnapshot);
dumper.dumpProjectInfos(projectInfos());
dumper.dumpSnapshot(globalSnapshot, globalSnapshotTitle, /*isGlobalSnapshot=*/ true);
dumper.dumpWorkingCopy(workingCopy());
ensureUpdated();
qDebug() << "=== Merged include paths ===";
foreach (const QString &inc, m_includePaths)
qDebug() << inc;
qDebug() << "=== Merged framework paths ===";
foreach (const QString &inc, m_frameworkPaths)
qDebug() << inc;
qDebug() << "=== Merged defined macros ===";
qDebug() << m_definedMacros;
qDebug() << "========= End of dump ======";
dumper.dumpMergedEntities(m_includePaths, m_frameworkPaths, m_definedMacros);
}
void CppModelManager::addExtraEditorSupport(AbstractEditorSupport *editorSupport)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment