[Lldb-commits] [lldb] [lldb-dap] add `debugAdapterExecutable` property to launch configuration (PR #126803)
Matthew Bastien via lldb-commits
lldb-commits at lists.llvm.org
Wed Feb 12 07:32:57 PST 2025
https://github.com/matthewbastien updated https://github.com/llvm/llvm-project/pull/126803
>From a07148100b02fa109cd3131d2d7742cdc0ae2bfa Mon Sep 17 00:00:00 2001
From: Matthew Bastien <matthew_bastien at apple.com>
Date: Tue, 11 Feb 2025 16:38:43 -0500
Subject: [PATCH 1/2] add `debugAdapterExecutable` property to launch
configuration
---
lldb/tools/lldb-dap/package.json | 10 +++++++++-
lldb/tools/lldb-dap/src-ts/debug-adapter-factory.ts | 9 +++++++--
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/lldb/tools/lldb-dap/package.json b/lldb/tools/lldb-dap/package.json
index e866af0602d70..d45c78432fa23 100644
--- a/lldb/tools/lldb-dap/package.json
+++ b/lldb/tools/lldb-dap/package.json
@@ -86,7 +86,7 @@
"default": {},
"description": "The environment of the lldb-dap process.",
"additionalProperties": {
- "type": "string"
+ "type": "string"
}
}
}
@@ -152,6 +152,10 @@
"program"
],
"properties": {
+ "debugAdapterExecutable": {
+ "type": "string",
+ "markdownDescription": "The LLDB debug adapter executable to use. Either an absolute path or the name of a debug adapter executable available on the `PATH`."
+ },
"program": {
"type": "string",
"description": "Path to the program to debug."
@@ -338,6 +342,10 @@
},
"attach": {
"properties": {
+ "debugAdapterExecutable": {
+ "type": "string",
+ "markdownDescription": "The LLDB debug adapter executable to use. Either an absolute path or the name of a debug adapter executable available on the `PATH`."
+ },
"program": {
"type": "string",
"description": "Path to the program to attach to."
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 55c2f3e9f7deb..e1c6bd4fd4300 100644
--- a/lldb/tools/lldb-dap/src-ts/debug-adapter-factory.ts
+++ b/lldb/tools/lldb-dap/src-ts/debug-adapter-factory.ts
@@ -67,12 +67,17 @@ async function findDAPExecutable(): Promise<string | undefined> {
async function getDAPExecutable(
session: vscode.DebugSession,
): Promise<string | undefined> {
+ // Check if the executable was provided in the launch configuration.
+ const launchConfigPath = session.configuration["debugAdapterExecutable"];
+ if (typeof launchConfigPath === "string" && launchConfigPath.length !== 0) {
+ return launchConfigPath;
+ }
+
+ // Check if the executable was provided in the extension's configuration.
const config = vscode.workspace.getConfiguration(
"lldb-dap",
session.workspaceFolder,
);
-
- // Prefer the explicitly specified path in the extension's configuration.
const configPath = config.get<string>("executable-path");
if (configPath && configPath.length !== 0) {
return configPath;
>From 28b9097c12de0b3ef5fe4f083c54ff5d0963c6c7 Mon Sep 17 00:00:00 2001
From: Matthew Bastien <matthew_bastien at apple.com>
Date: Wed, 12 Feb 2025 10:32:36 -0500
Subject: [PATCH 2/2] reword description of debugAdapterExecutable
---
lldb/tools/lldb-dap/package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lldb/tools/lldb-dap/package.json b/lldb/tools/lldb-dap/package.json
index d45c78432fa23..edcae59867b53 100644
--- a/lldb/tools/lldb-dap/package.json
+++ b/lldb/tools/lldb-dap/package.json
@@ -154,7 +154,7 @@
"properties": {
"debugAdapterExecutable": {
"type": "string",
- "markdownDescription": "The LLDB debug adapter executable to use. Either an absolute path or the name of a debug adapter executable available on the `PATH`."
+ "markdownDescription": "The absolute path to the LLDB debug adapter executable to use."
},
"program": {
"type": "string",
@@ -344,7 +344,7 @@
"properties": {
"debugAdapterExecutable": {
"type": "string",
- "markdownDescription": "The LLDB debug adapter executable to use. Either an absolute path or the name of a debug adapter executable available on the `PATH`."
+ "markdownDescription": "The absolute path to the LLDB debug adapter executable to use."
},
"program": {
"type": "string",
More information about the lldb-commits
mailing list