Skip to content

Commit a071481

Browse files
add debugAdapterExecutable property to launch configuration
1 parent 3c74430 commit a071481

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

lldb/tools/lldb-dap/package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
"default": {},
8787
"description": "The environment of the lldb-dap process.",
8888
"additionalProperties": {
89-
"type": "string"
89+
"type": "string"
9090
}
9191
}
9292
}
@@ -152,6 +152,10 @@
152152
"program"
153153
],
154154
"properties": {
155+
"debugAdapterExecutable": {
156+
"type": "string",
157+
"markdownDescription": "The LLDB debug adapter executable to use. Either an absolute path or the name of a debug adapter executable available on the `PATH`."
158+
},
155159
"program": {
156160
"type": "string",
157161
"description": "Path to the program to debug."
@@ -338,6 +342,10 @@
338342
},
339343
"attach": {
340344
"properties": {
345+
"debugAdapterExecutable": {
346+
"type": "string",
347+
"markdownDescription": "The LLDB debug adapter executable to use. Either an absolute path or the name of a debug adapter executable available on the `PATH`."
348+
},
341349
"program": {
342350
"type": "string",
343351
"description": "Path to the program to attach to."

lldb/tools/lldb-dap/src-ts/debug-adapter-factory.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,17 @@ async function findDAPExecutable(): Promise<string | undefined> {
6767
async function getDAPExecutable(
6868
session: vscode.DebugSession,
6969
): Promise<string | undefined> {
70+
// Check if the executable was provided in the launch configuration.
71+
const launchConfigPath = session.configuration["debugAdapterExecutable"];
72+
if (typeof launchConfigPath === "string" && launchConfigPath.length !== 0) {
73+
return launchConfigPath;
74+
}
75+
76+
// Check if the executable was provided in the extension's configuration.
7077
const config = vscode.workspace.getConfiguration(
7178
"lldb-dap",
7279
session.workspaceFolder,
7380
);
74-
75-
// Prefer the explicitly specified path in the extension's configuration.
7681
const configPath = config.get<string>("executable-path");
7782
if (configPath && configPath.length !== 0) {
7883
return configPath;

0 commit comments

Comments
 (0)