[Lldb-commits] [lldb] [lldb-dap] Allow providing debug adapter arguments in the extension (PR #129262)

Adrian Vogelsgesang via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 28 19:46:09 PST 2025


================
@@ -137,53 +157,59 @@ export class LLDBDapDescriptorFactory
 
     const dbgOptions = {
       env: {
-        ...executable?.options?.env,
         ...configEnvironment,
         ...env,
       },
     };
-    const dbgArgs = executable?.args ?? [];
+    const dbgArgs = getDAPArguments(session);
 
-    const serverMode = config.get<boolean>('serverMode', false);
+    const serverMode = config.get<boolean>("serverMode", false);
     if (serverMode) {
-      const { host, port } = await this.startServer(dapPath, dbgArgs, dbgOptions);
+      const { host, port } = await this.startServer(
+        dapPath,
+        dbgArgs,
+        dbgOptions,
+      );
       return new vscode.DebugAdapterServer(port, host);
     }
 
     return new vscode.DebugAdapterExecutable(dapPath, dbgArgs, dbgOptions);
   }
 
-  startServer(dapPath: string, args: string[], options: child_process.CommonSpawnOptions): Promise<{ host: string, port: number }> {
-    if (this.server) return this.server;
+  startServer(
+    dapPath: string,
+    args: string[],
+    options: child_process.CommonSpawnOptions,
+  ): Promise<{ host: string; port: number }> {
+    if (this.server) {
+      return this.server;
+    }
----------------
vogelsgesang wrote:

I assume we would only show this prompt if we detect a mismatch in either the `lldb-dap` binary path or the provided arguments?

https://github.com/llvm/llvm-project/pull/129262


More information about the lldb-commits mailing list