https://github.com/award999 created 
https://github.com/llvm/llvm-project/pull/142470

- Allow running when no workspace folder is present, and do not override the 
`cwd` set in the launch configuration
- Support getting configuration from workspace file

Issue: #142469

>From 5eec6c7d71bb3bc9c6b8fda79e7e72e604790a2a Mon Sep 17 00:00:00 2001
From: Adam Ward <award...@apple.com>
Date: Mon, 2 Jun 2025 15:47:47 -0400
Subject: [PATCH] Have lldb-dap extension support multi-root workspace

- Allow running when no workspace folder is present, and do not override
  the `cwd` set in the launch configuration
- Support getting configuration from workspace file

Issue: #142469
---
 lldb/tools/lldb-dap/src-ts/debug-adapter-factory.ts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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 d61b81e4c041f..b5db45b56d6a6 100644
--- a/lldb/tools/lldb-dap/src-ts/debug-adapter-factory.ts
+++ b/lldb/tools/lldb-dap/src-ts/debug-adapter-factory.ts
@@ -169,7 +169,7 @@ export async function createDebugAdapterExecutable(
   workspaceFolder: vscode.WorkspaceFolder | undefined,
   configuration: vscode.DebugConfiguration,
 ): Promise<vscode.DebugAdapterExecutable> {
-  const config = vscode.workspace.getConfiguration("lldb-dap", 
workspaceFolder);
+  const config = vscode.workspace.workspaceFile ? 
vscode.workspace.getConfiguration("lldb-dap") : 
vscode.workspace.getConfiguration("lldb-dap", workspaceFolder);
   const log_path = config.get<string>("log-path");
   let env: { [key: string]: string } = {};
   if (log_path) {
@@ -184,7 +184,7 @@ export async function createDebugAdapterExecutable(
       ...configEnvironment,
       ...env,
     },
-    cwd: workspaceFolder!!.uri.fsPath,
+    cwd: configuration.cwd ?? workspaceFolder?.uri.fsPath,
   };
   const dbgArgs = await getDAPArguments(workspaceFolder, configuration);
 

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to