================
@@ -17,10 +18,32 @@ function createDefaultLLDBDapOptions(): LLDBDapOptions {
       const path = vscode.workspace
         .getConfiguration("lldb-dap", session.workspaceFolder)
         .get<string>("executable-path");
-      if (path) {
-        return new vscode.DebugAdapterExecutable(path, []);
+
+      if (!path) {
+        return packageJSONExecutable;
+      }
+
+      try {
+        const fileStats = await fs.stat(path);
+        if (!fileStats.isFile() && !fileStats.isSymbolicLink()) {
+          throw new Error(`Error: ${path} is not a file`);
+        }
+      } catch (err) {
+        const error: Error = err as Error;
+        const openSettingsAction = "Open Settings";
+        const callBackValue = await vscode.window.showErrorMessage(
+          error.message,
+          { modal: true },
+          openSettingsAction,
+        );
+        if (openSettingsAction === callBackValue) {
+          vscode.commands.executeCommand(
+            "workbench.action.openSettings",
+            "lldb-dap.executable-path",
+          );
+        }
       }
-      return packageJSONExecutable;
+      return new vscode.DebugAdapterExecutable(path, []);
----------------
Da-Viper wrote:

the first one is when there is a directory / device/ socket (any thing that is 
not an actual file) that exists in that path 

the second one is when there is nothing in that path

https://github.com/llvm/llvm-project/pull/104711
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to