[Lldb-commits] [lldb] [lldb-dap] Allow providing debug adapter arguments in the extension (PR #129262)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Fri Feb 28 08:19:41 PST 2025
================
@@ -116,40 +131,31 @@ export class LLDBDapDescriptorFactory
const configEnvironment =
config.get<{ [key: string]: string }>("environment") || {};
const dapPath = await getDAPExecutable(session);
+ const dapArgs = getDAPArguments(session);
const dbgOptions = {
env: {
- ...executable?.options?.env,
...configEnvironment,
...env,
},
};
- if (dapPath) {
- if (!(await isExecutable(dapPath))) {
- LLDBDapDescriptorFactory.showLLDBDapNotFoundMessage(dapPath);
- return undefined;
- }
- return new vscode.DebugAdapterExecutable(dapPath, [], dbgOptions);
- } else if (executable) {
- if (!(await isExecutable(executable.command))) {
- LLDBDapDescriptorFactory.showLLDBDapNotFoundMessage(executable.command);
- return undefined;
- }
- return new vscode.DebugAdapterExecutable(
- executable.command,
- executable.args,
- dbgOptions,
- );
+ if (dapPath === undefined || !(await isExecutable(dapPath))) {
+ LLDBDapDescriptorFactory.showLLDBDapNotFoundMessage(dapPath);
+ return undefined;
}
- return undefined;
+ return new vscode.DebugAdapterExecutable(dapPath, dapArgs, dbgOptions);
}
/**
* Shows a message box when the debug adapter's path is not found
*/
- static async showLLDBDapNotFoundMessage(path: string) {
+ static async showLLDBDapNotFoundMessage(path: string | undefined) {
const openSettingsAction = "Open Settings";
+ const message =
+ path === undefined
+ ? "Unable to find the LLDB debug adapter executable."
+ : `Debug adapter path: ${path} is not a valid file`;
----------------
JDevlieghere wrote:
Either both or neither should have a period at the end (and whichever we pick, it should match what we do elsewhere).
https://github.com/llvm/llvm-project/pull/129262
More information about the lldb-commits
mailing list