diff options
author | Glen Chung <kuchung@microsoft.com> | 2023-03-16 00:50:08 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-05-30 13:46:12 (GMT) |
commit | a9a592f96e6498da302f8e968be1db0ad3c32123 (patch) | |
tree | 0d75f16ee2eae99b1a3f063e575b3f5f8f2ee931 /Source/cmake.h | |
parent | b0d1ddb7234950374977b83f8dbded806c15b356 (diff) | |
download | CMake-a9a592f96e6498da302f8e968be1db0ad3c32123.zip CMake-a9a592f96e6498da302f8e968be1db0ad3c32123.tar.gz CMake-a9a592f96e6498da302f8e968be1db0ad3c32123.tar.bz2 |
cmake: Add debugger
- Depends on cppdap and jsoncpp.
- Add --debugger argument to enable the Debugger.
- Add --debugger-pipe argument for DAP traffics over named pipes.
- Support breakpoints by filenames and line numbers.
- Support exception breakpoints.
- Call stack shows filenames and line numbers.
- Show Cache Variables.
- Show the state of currently defined targets,
tests and directories with their properties.
- Add cmakeVersion to DAP initialize response.
- Include unit tests.
Co-authored-by: Ben McMorran <bemcmorr@microsoft.com>
Diffstat (limited to 'Source/cmake.h')
-rw-r--r-- | Source/cmake.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Source/cmake.h b/Source/cmake.h index 955ec4f..d394a3e 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -37,6 +37,13 @@ #endif class cmConfigureLog; + +#ifdef CMake_ENABLE_DEBUGGER +namespace cmDebugger { +class cmDebuggerAdapter; +} +#endif + class cmExternalMakefileProjectGeneratorFactory; class cmFileAPI; class cmFileTimeCache; @@ -662,6 +669,23 @@ public: } #endif +#ifdef CMake_ENABLE_DEBUGGER + bool GetDebuggerOn() const { return this->DebuggerOn; } + std::string GetDebuggerPipe() const { return this->DebuggerPipe; } + std::string GetDebuggerDapLogFile() const + { + return this->DebuggerDapLogFile; + } + void SetDebuggerOn(bool b) { this->DebuggerOn = b; } + bool StartDebuggerIfEnabled(); + void StopDebuggerIfNeeded(int exitCode); + std::shared_ptr<cmDebugger::cmDebuggerAdapter> GetDebugAdapter() + const noexcept + { + return this->DebugAdapter; + } +#endif + protected: void RunCheckForUnusedVariables(); int HandleDeleteCacheVariables(const std::string& var); @@ -802,6 +826,13 @@ private: std::unique_ptr<cmMakefileProfilingData> ProfilingOutput; #endif +#ifdef CMake_ENABLE_DEBUGGER + std::shared_ptr<cmDebugger::cmDebuggerAdapter> DebugAdapter; + bool DebuggerOn = false; + std::string DebuggerPipe; + std::string DebuggerDapLogFile; +#endif + public: static cmDocumentationEntry CMAKE_STANDARD_OPTIONS_TABLE[18]; }; |