Author: Charles Zablit
Date: 2026-07-22T14:56:01+02:00
New Revision: 6ac80addbe9c12dd0a110a76fa2c09eb53764e64

URL: 
https://github.com/llvm/llvm-project/commit/6ac80addbe9c12dd0a110a76fa2c09eb53764e64
DIFF: 
https://github.com/llvm/llvm-project/commit/6ac80addbe9c12dd0a110a76fa2c09eb53764e64.diff

LOG: [lldb-dap][VSCode][Windows] check that --check-python is available before 
using it (#211048)

`--check-python` is only available as of lldb-dap 23. Running that check
regardless of it's availability causes the extension to fail to start if
it's not available.

Check that the flag is available first by searching for it in the
`--help`. Checking for a version number would be a cleaner approach but
I reckon it would fail for local builds.

Fixes https://github.com/llvm/llvm-project/issues/210879

Added: 
    

Modified: 
    lldb/tools/lldb-dap/extension/src/debug-configuration-provider.ts

Removed: 
    


################################################################################
diff  --git a/lldb/tools/lldb-dap/extension/src/debug-configuration-provider.ts 
b/lldb/tools/lldb-dap/extension/src/debug-configuration-provider.ts
index bba9d1e1b5faa..d262055f4c7fe 100644
--- a/lldb/tools/lldb-dap/extension/src/debug-configuration-provider.ts
+++ b/lldb/tools/lldb-dap/extension/src/debug-configuration-provider.ts
@@ -237,19 +237,25 @@ export class LLDBDapConfigurationProvider
         }
 
         if (os.platform() === "win32") {
-          const pythonCheckProcess = child_process.spawnSync(
+          const lldbDapProcess = child_process.spawnSync(
             executable.command,
-            ["--check-python"],
+            ["--help"],
           );
-          if (pythonCheckProcess.status !== 0) {
-            await vscode.window.showErrorMessage(
-              "Python is not installed correctly. Please install it to use 
lldb-dap.",
-              {
-                modal: true,
-                detail: pythonCheckProcess.stderr?.toString() ?? "",
-              },
+          if (lldbDapProcess.stdout?.toString().includes("--check-python")) {
+            const pythonCheckProcess = child_process.spawnSync(
+              executable.command,
+              ["--check-python"],
             );
-            return undefined;
+            if (pythonCheckProcess.status !== 0) {
+              await vscode.window.showErrorMessage(
+                "Python is not installed correctly. Please install it to use 
lldb-dap.",
+                {
+                  modal: true,
+                  detail: pythonCheckProcess.stderr?.toString() ?? "",
+                },
+              );
+              return undefined;
+            }
           }
         }
 


        
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to