Skip to content

[lldb-dap] add debugAdapterExecutable property to launch configuration #126803

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lldb/tools/lldb-dap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"default": {},
"description": "The environment of the lldb-dap process.",
"additionalProperties": {
"type": "string"
"type": "string"
}
}
}
Expand Down Expand Up @@ -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."
Expand Down Expand Up @@ -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."
Expand Down
9 changes: 7 additions & 2 deletions lldb/tools/lldb-dap/src-ts/debug-adapter-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,17 @@ async function findDAPExecutable(): Promise<string | undefined> {
async function getDAPExecutable(
session: vscode.DebugSession,
): Promise<string | undefined> {
// 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<string>("executable-path");
if (configPath && configPath.length !== 0) {
return configPath;
Expand Down