diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmFileAPICodemodel.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx index 2f36db2..e7bfc61 100644 --- a/Source/cmFileAPICodemodel.cxx +++ b/Source/cmFileAPICodemodel.cxx @@ -379,6 +379,9 @@ class DirectoryObject std::string const& Config; std::string TopSource; std::string TopBuild; + BacktraceData Backtraces; + + void AddBacktrace(Json::Value& object, cmListFileBacktrace const& bt); Json::Value DumpPaths(); @@ -814,6 +817,7 @@ DirectoryObject::DirectoryObject(cmLocalGenerator const* lg, , TopSource(lg->GetGlobalGenerator()->GetCMakeInstance()->GetHomeDirectory()) , TopBuild( lg->GetGlobalGenerator()->GetCMakeInstance()->GetHomeOutputDirectory()) + , Backtraces(this->TopSource) { } @@ -821,9 +825,18 @@ Json::Value DirectoryObject::Dump() { Json::Value directoryObject = Json::objectValue; directoryObject["paths"] = this->DumpPaths(); + directoryObject["backtraceGraph"] = this->Backtraces.Dump(); return directoryObject; } +void DirectoryObject::AddBacktrace(Json::Value& object, + cmListFileBacktrace const& bt) +{ + if (JBTIndex backtrace = this->Backtraces.Add(bt)) { + object["backtrace"] = backtrace.Index; + } +} + Json::Value DirectoryObject::DumpPaths() { Json::Value paths = Json::objectValue; |