diff --git a/lldb/tools/lldb-dap/package.json b/lldb/tools/lldb-dap/package.json index e866af0602d70..edcae59867b53 100644 --- a/lldb/tools/lldb-dap/package.json +++ b/lldb/tools/lldb-dap/package.json @@ -86,7 +86,7 @@ "default": {}, "description": "The environment of the lldb-dap process.", "additionalProperties": { - "type": "string" + "type": "string" } } } @@ -152,6 +152,10 @@ "program" ], "properties": { + "debugAdapterExecutable": { + "type": "string", + "markdownDescription": "The absolute path to the LLDB debug adapter executable to use." + }, "program": { "type": "string", "description": "Path to the program to debug." @@ -338,6 +342,10 @@ }, "attach": { "properties": { + "debugAdapterExecutable": { + "type": "string", + "markdownDescription": "The absolute path to the LLDB debug adapter executable to use." + }, "program": { "type": "string", "description": "Path to the program to attach to." diff --git a/lldb/tools/lldb-dap/src-ts/debug-adapter-factory.ts b/lldb/tools/lldb-dap/src-ts/debug-adapter-factory.ts index 55c2f3e9f7deb..e1c6bd4fd4300 100644 --- a/lldb/tools/lldb-dap/src-ts/debug-adapter-factory.ts +++ b/lldb/tools/lldb-dap/src-ts/debug-adapter-factory.ts @@ -67,12 +67,17 @@ async function findDAPExecutable(): Promise { async function getDAPExecutable( session: vscode.DebugSession, ): Promise { + // Check if the executable was provided in the launch configuration. + const launchConfigPath = session.configuration["debugAdapterExecutable"]; + if (typeof launchConfigPath === "string" && launchConfigPath.length !== 0) { + return launchConfigPath; + } + + // Check if the executable was provided in the extension's configuration. const config = vscode.workspace.getConfiguration( "lldb-dap", session.workspaceFolder, ); - - // Prefer the explicitly specified path in the extension's configuration. const configPath = config.get("executable-path"); if (configPath && configPath.length !== 0) { return configPath;