summaryrefslogtreecommitdiffstats
path: root/Source/cmDebuggerVariablesHelper.h
diff options
context:
space:
mode:
authorGlen Chung <kuchung@microsoft.com>2023-03-16 00:50:08 (GMT)
committerBrad King <brad.king@kitware.com>2023-05-30 13:46:12 (GMT)
commita9a592f96e6498da302f8e968be1db0ad3c32123 (patch)
tree0d75f16ee2eae99b1a3f063e575b3f5f8f2ee931 /Source/cmDebuggerVariablesHelper.h
parentb0d1ddb7234950374977b83f8dbded806c15b356 (diff)
downloadCMake-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/cmDebuggerVariablesHelper.h')
-rw-r--r--Source/cmDebuggerVariablesHelper.h106
1 files changed, 106 insertions, 0 deletions
diff --git a/Source/cmDebuggerVariablesHelper.h b/Source/cmDebuggerVariablesHelper.h
new file mode 100644
index 0000000..9b11eaf
--- /dev/null
+++ b/Source/cmDebuggerVariablesHelper.h
@@ -0,0 +1,106 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#pragma once
+
+#include "cmConfigure.h" // IWYU pragma: keep
+
+#include <memory>
+#include <set>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "cmAlgorithms.h"
+#include "cmPolicies.h"
+
+class cmFileSet;
+class cmGlobalGenerator;
+class cmMakefile;
+class cmTarget;
+class cmTest;
+
+namespace cmDebugger {
+class cmDebuggerStackFrame;
+class cmDebuggerVariables;
+class cmDebuggerVariablesManager;
+}
+
+template <typename T>
+class BT;
+
+namespace cmDebugger {
+
+class cmDebuggerVariablesHelper
+{
+ cmDebuggerVariablesHelper() = default;
+
+public:
+ static std::shared_ptr<cmDebuggerVariables> Create(
+ std::shared_ptr<cmDebuggerVariablesManager> const& variablesManager,
+ std::string const& name, bool supportsVariableType,
+ cmPolicies::PolicyMap const& policyMap);
+
+ static std::shared_ptr<cmDebuggerVariables> CreateIfAny(
+ std::shared_ptr<cmDebuggerVariablesManager> const& variablesManager,
+ std::string const& name, bool supportsVariableType,
+ std::vector<std::pair<std::string, std::string>> const& list);
+
+ static std::shared_ptr<cmDebuggerVariables> CreateIfAny(
+ std::shared_ptr<cmDebuggerVariablesManager> const& variablesManager,
+ std::string const& name, bool supportsVariableType,
+ cmBTStringRange const& entries);
+
+ static std::shared_ptr<cmDebuggerVariables> CreateIfAny(
+ std::shared_ptr<cmDebuggerVariablesManager> const& variablesManager,
+ std::string const& name, bool supportsVariableType,
+ std::set<std::string> const& values);
+
+ static std::shared_ptr<cmDebuggerVariables> CreateIfAny(
+ std::shared_ptr<cmDebuggerVariablesManager> const& variablesManager,
+ std::string const& name, bool supportsVariableType,
+ std::vector<std::string> const& values);
+
+ static std::shared_ptr<cmDebuggerVariables> CreateIfAny(
+ std::shared_ptr<cmDebuggerVariablesManager> const& variablesManager,
+ std::string const& name, bool supportsVariableType,
+ std::vector<BT<std::string>> const& list);
+
+ static std::shared_ptr<cmDebuggerVariables> CreateIfAny(
+ std::shared_ptr<cmDebuggerVariablesManager> const& variablesManager,
+ std::string const& name, bool supportsVariableType, cmFileSet* fileSet);
+
+ static std::shared_ptr<cmDebuggerVariables> CreateIfAny(
+ std::shared_ptr<cmDebuggerVariablesManager> const& variablesManager,
+ std::string const& name, bool supportsVariableType,
+ std::vector<cmFileSet*> const& fileSets);
+
+ static std::shared_ptr<cmDebuggerVariables> CreateIfAny(
+ std::shared_ptr<cmDebuggerVariablesManager> const& variablesManager,
+ std::string const& name, bool supportsVariableType, cmTest* test);
+
+ static std::shared_ptr<cmDebuggerVariables> CreateIfAny(
+ std::shared_ptr<cmDebuggerVariablesManager> const& variablesManager,
+ std::string const& name, bool supportsVariableType,
+ std::vector<cmTest*> const& tests);
+
+ static std::shared_ptr<cmDebuggerVariables> CreateIfAny(
+ std::shared_ptr<cmDebuggerVariablesManager> const& variablesManager,
+ std::string const& name, bool supportsVariableType,
+ std::vector<cmTarget*> const& targets);
+
+ static std::shared_ptr<cmDebuggerVariables> Create(
+ std::shared_ptr<cmDebuggerVariablesManager> const& variablesManager,
+ std::string const& name, bool supportsVariableType,
+ std::shared_ptr<cmDebuggerStackFrame> const& frame);
+
+ static std::shared_ptr<cmDebuggerVariables> CreateIfAny(
+ std::shared_ptr<cmDebuggerVariablesManager> const& variablesManager,
+ std::string const& name, bool supportsVariableType, cmMakefile* mf);
+
+ static std::shared_ptr<cmDebuggerVariables> CreateIfAny(
+ std::shared_ptr<cmDebuggerVariablesManager> const& variablesManager,
+ std::string const& name, bool supportsVariableType,
+ cmGlobalGenerator* gen);
+};
+
+} // namespace cmDebugger