[Lldb-commits] [lldb] [lldb-dap] Support finding the lldb-dap binary (PR #118547)

John Harrison via lldb-commits lldb-commits at lists.llvm.org
Tue Dec 3 14:44:22 PST 2024


================
@@ -8,15 +11,7 @@ import { LLDBDapOptions } from "./types";
 export class LLDBDapDescriptorFactory
   implements vscode.DebugAdapterDescriptorFactory
 {
-  private lldbDapOptions: LLDBDapOptions;
-
-  constructor(lldbDapOptions: LLDBDapOptions) {
-    this.lldbDapOptions = lldbDapOptions;
-  }
-
-  static async isValidDebugAdapterPath(
-    pathUri: vscode.Uri,
-  ): Promise<Boolean> {
+  static async isValidFile(pathUri: vscode.Uri): Promise<Boolean> {
     try {
----------------
ashgti wrote:

We may want to validate that the file is executable. It looks like the VS Code FS API doesn't have that info but we could use the node FS instead, something like:
```
import { access, constants } from 'node:fs/promises';

try {
  await access('<path>', constants.X_OK);
  console.log('can execute');
} catch {
  console.error('cannot execute');
} 
```

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


More information about the lldb-commits mailing list