Debugger: Allow GDB/LLDB DAP debugger as native C++ debugger

This would allow manual registration of a GDB/LLDB DAP debugger from a
CMake configure preset as follows:

```
  "vendor": {
      "qt.io/QtCreator/1.0": {
        "debugger": {
          "DisplayName": "LLDB Dap 18.1.7 Debugger",
          "Abis": ["arm-darwin-generic-mach_o-64bit"],
          "Binary": "/Users/cristian/llvm/clang/bin/lldb-dap",
          "EngineType": 1024,
          "Version": "18.1.7"
        }
      }
    }
```

This way I can configure a project with a toolchain that uses a DAP
debugger (not every gdb/lldb has python bindings) and have debugging
working out of the box.

Change-Id: Id9bff26b6544b7af99caccb18cdbe0edb334218a
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Cristian Adam
2024-06-14 11:23:42 +02:00
parent 834e0867b0
commit 8a7402c7cd
4 changed files with 14 additions and 0 deletions

View File

@@ -100,6 +100,8 @@ enum DebuggerEngineType
GdbEngineType = 0x001,
CdbEngineType = 0x004,
LldbEngineType = 0x100,
GdbDapEngineType = 0x200,
LldbDapEngineType = 0x400,
UvscEngineType = 0x1000
};

View File

@@ -2625,6 +2625,8 @@ bool DebuggerRunParameters::isCppDebugging() const
return cppEngineType == GdbEngineType
|| cppEngineType == LldbEngineType
|| cppEngineType == CdbEngineType
|| cppEngineType == GdbDapEngineType
|| cppEngineType == LldbDapEngineType
|| cppEngineType == UvscEngineType;
}

View File

@@ -271,6 +271,10 @@ QString DebuggerItem::engineTypeName() const
return QLatin1String("CDB");
case LldbEngineType:
return QLatin1String("LLDB");
case GdbDapEngineType:
return QLatin1String("GDB DAP");
case LldbDapEngineType:
return QLatin1String("LLDB DAP");
case UvscEngineType:
return QLatin1String("UVSC");
default:

View File

@@ -494,6 +494,12 @@ void DebuggerRunTool::start()
case LldbEngineType:
m_engines << createLldbEngine();
break;
case GdbDapEngineType:
m_engines << createDapEngine(ProjectExplorer::Constants::DAP_GDB_DEBUG_RUN_MODE);
break;
case LldbDapEngineType:
m_engines << createDapEngine(ProjectExplorer::Constants::DAP_LLDB_DEBUG_RUN_MODE);
break;
case UvscEngineType:
m_engines << createUvscEngine();
break;