diff options
author | Brad King <brad.king@kitware.com> | 2017-12-06 16:23:58 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-12-06 16:39:03 (GMT) |
commit | 8b2736c71ca6eb8e62a69f57ad07e4e19a95c936 (patch) | |
tree | df7d3ab1300b235da99e0870efaaefe8c487e567 /Source/cmServerProtocol.cxx | |
parent | 7746fdb2fe0177341aadeafec2ae73aa08ddfaf6 (diff) | |
download | CMake-8b2736c71ca6eb8e62a69f57ad07e4e19a95c936.zip CMake-8b2736c71ca6eb8e62a69f57ad07e4e19a95c936.tar.gz CMake-8b2736c71ca6eb8e62a69f57ad07e4e19a95c936.tar.bz2 |
server: Revert "Report backtraces in codemodel response"
The backtrace information is very repetitive and hugely increases the
size of the codemodel object. We need to remove it until an alternative
representation can be developed. Revert commit v3.10.0-rc1~393^2
(server: Report backtraces in codemodel response, 2017-06-20), except
for the protocol version number (because it indicates other new things).
Unfortunately this is incompatible with clients that expect the
"crossReferences" field in targets. However, the regression in memory
usage is quite serious, especially on large projects, and therefore
breaks even older clients that do not use backtraces. Since the
"crossReferences" field was only provided by one release (3.10.0), it is
simplest to revert it outright for 3.10.1.
Fixes: #17502
Diffstat (limited to 'Source/cmServerProtocol.cxx')
-rw-r--r-- | Source/cmServerProtocol.cxx | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index e835b7a..13b18c2 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -9,7 +9,6 @@ #include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" #include "cmLinkLineComputer.h" -#include "cmListFileCache.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmServer.h" @@ -20,7 +19,6 @@ #include "cmStateSnapshot.h" #include "cmStateTypes.h" #include "cmSystemTools.h" -#include "cmTarget.h" #include "cm_uv.h" #include "cmake.h" @@ -732,37 +730,6 @@ static Json::Value DumpSourceFilesList( return result; } -static Json::Value DumpBacktrace(const cmListFileBacktrace& backtrace) -{ - Json::Value result = Json::arrayValue; - - cmListFileBacktrace backtraceCopy = backtrace; - while (!backtraceCopy.Top().FilePath.empty()) { - Json::Value entry = Json::objectValue; - entry[kPATH_KEY] = backtraceCopy.Top().FilePath; - if (backtraceCopy.Top().Line) { - entry[kLINE_NUMBER_KEY] = static_cast<int>(backtraceCopy.Top().Line); - } - if (!backtraceCopy.Top().Name.empty()) { - entry[kNAME_KEY] = backtraceCopy.Top().Name; - } - result.append(entry); - backtraceCopy = backtraceCopy.Pop(); - } - return result; -} - -static void DumpBacktraceRange(Json::Value& result, const std::string& type, - cmBacktraceRange range) -{ - for (auto const& bt : range) { - Json::Value obj = Json::objectValue; - obj[kTYPE_KEY] = type; - obj[kBACKTRACE_KEY] = DumpBacktrace(bt); - result.append(obj); - } -} - static Json::Value DumpTarget(cmGeneratorTarget* target, const std::string& config) { @@ -797,22 +764,6 @@ static Json::Value DumpTarget(cmGeneratorTarget* target, result[kFULL_NAME_KEY] = target->GetFullName(config); - Json::Value crossRefs = Json::objectValue; - crossRefs[kBACKTRACE_KEY] = DumpBacktrace(target->Target->GetBacktrace()); - - Json::Value statements = Json::arrayValue; - DumpBacktraceRange(statements, "target_compile_definitions", - target->Target->GetCompileDefinitionsBacktraces()); - DumpBacktraceRange(statements, "target_include_directories", - target->Target->GetIncludeDirectoriesBacktraces()); - DumpBacktraceRange(statements, "target_compile_options", - target->Target->GetCompileOptionsBacktraces()); - DumpBacktraceRange(statements, "target_link_libraries", - target->Target->GetLinkImplementationBacktraces()); - - crossRefs[kRELATED_STATEMENTS_KEY] = std::move(statements); - result[kTARGET_CROSS_REFERENCES_KEY] = std::move(crossRefs); - if (target->HaveWellDefinedOutputFiles()) { Json::Value artifacts = Json::arrayValue; artifacts.append( |