DAP: Separate CMake and Gdb logic in DAP engine

This commit refactors the Debug Adapter Protocol (DAP) engine
to separate the logic for CMake-based projects and Gdb-based
debugging.

- Moved CMake-specific code to a new CMakeDAPEngine class
- Moved Gdb-specific code to a new GdbDAPEngine class

Change-Id: Ia616e7b7ea2ff2071bcadd26b28b620f9aca6ac4
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Artem Sokolovskii
2023-08-08 15:37:39 +02:00
parent 8fcf3a695f
commit 1836b50f5d
8 changed files with 287 additions and 160 deletions

View File

@@ -70,7 +70,7 @@ DebuggerEngine *createPdbEngine();
DebuggerEngine *createQmlEngine();
DebuggerEngine *createLldbEngine();
DebuggerEngine *createUvscEngine();
DebuggerEngine *createDapEngine();
DebuggerEngine *createDapEngine(Utils::Id runMode = ProjectExplorer::Constants::NO_RUN_MODE);
static QString noEngineMessage()
{
@@ -483,7 +483,7 @@ void DebuggerRunTool::start()
if (!m_engine) {
if (runControl()->runMode() == ProjectExplorer::Constants::CMAKE_DEBUG_RUN_MODE)
m_engine = createDapEngine();
m_engine = createDapEngine(runControl()->runMode());
else if (m_runParameters.isCppDebugging()) {
switch (m_runParameters.cppEngineType) {
case GdbEngineType: