DAP: Add CMake support to DAP engine

Added CMake support to the DAP engine in Qt Creator.
This feature can be enabled by setting the environment
variable QTC_USE_CMAKE_DEBUGGER. CMake debug session can
be started by clicking "Run CMake" or "Run".

Note:
Doesn't work with "Run debugging" in this patch.
Works only with cmake 3.27.0 and newer.

Change-Id: I756ea57f507aa4a6621ad62a8c0ef52c44a5185d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Artem Sokolovskii
2023-06-27 16:57:51 +02:00
parent 52bc1578e5
commit 1fc0ca5277
8 changed files with 272 additions and 69 deletions

View File

@@ -310,6 +310,11 @@ void DebuggerRunTool::setRunAsRoot(bool on)
m_runParameters.runAsRoot = on;
}
void DebuggerRunTool::setCmakeDapDebugging(bool on)
{
m_runParameters.cmakeDapDebugging = on;
}
void DebuggerRunTool::setCommandsAfterConnect(const QString &commands)
{
m_runParameters.commandsAfterConnect = commands;
@@ -487,6 +492,9 @@ void DebuggerRunTool::start()
runControl()->setDisplayName(m_runParameters.displayName);
if (!m_engine && m_runParameters.cmakeDapDebugging)
m_engine = createDapEngine();
if (!m_engine) {
if (m_runParameters.isCppDebugging()) {
switch (m_runParameters.cppEngineType) {