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
Date: Tue, 11 Feb 2025 16:38:43 -0500
Subject: [PATCH 1/2] add `debugAdapterExecutable` property to launch
co
@@ -152,6 +152,10 @@
"program"
],
"properties": {
+ "debugAdapterExecutable": {
+"type": "string",
+"markdownDescription": "The LLDB debug adapter executable to
use. Either an absolute path or t
https://github.com/matthewbastien created
https://github.com/llvm/llvm-project/pull/124986
The published VSIX for the LLDB DAP extension contains a bunch of unnecessary
files:
```
❯ tar tf llvm-vs-code-extensions.lldb-dap-0.2.8.vsix
extension.vsixmanifest
[Content_Types].xml
extension/.github/
https://github.com/matthewbastien edited
https://github.com/llvm/llvm-project/pull/124986
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/matthewbastien edited
https://github.com/llvm/llvm-project/pull/124986
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/matthewbastien edited
https://github.com/llvm/llvm-project/pull/124986
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/matthewbastien created
https://github.com/llvm/llvm-project/pull/126803
The Swift extension for VS Code requires that the `lldb-dap` executable come
from the Swift toolchain which may or may not be configured in `PATH`. At the
moment, this can be configured via LLDB DAP's ex
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
Date: Tue, 11 Feb 2025 16:38:43 -0500
Subject: [PATCH] add `debugAdapterExecutable` property to launch configu
https://github.com/matthewbastien created
https://github.com/llvm/llvm-project/pull/128943
Adds a process picker command to the LLDB DAP extension that will prompt the
user to select a process running on their machine. It is hidden from the
command palette, but can be used in an `"attach"` deb
https://github.com/matthewbastien updated
https://github.com/llvm/llvm-project/pull/128943
>From b9083ea16c7b1dba70cc04acf78f5001f0fb86c6 Mon Sep 17 00:00:00 2001
From: Matthew Bastien
Date: Wed, 26 Feb 2025 11:18:21 -0500
Subject: [PATCH 1/3] add a process picker for attaching by PID
---
lld
https://github.com/matthewbastien updated
https://github.com/llvm/llvm-project/pull/128943
>From b9083ea16c7b1dba70cc04acf78f5001f0fb86c6 Mon Sep 17 00:00:00 2001
From: Matthew Bastien
Date: Wed, 26 Feb 2025 11:18:21 -0500
Subject: [PATCH 1/4] add a process picker for attaching by PID
---
lld
matthewbastien wrote:
Yeah, the CodeLLDB extension uses `lldb` to print the processes for the current
platform (which could be a possibility as well, though then you'd also have to
have an option to specify the `lldb` executable alongside `lldb-dap`). I'd
rather have a NodeJS approach if only
https://github.com/matthewbastien edited
https://github.com/llvm/llvm-project/pull/129262
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/matthewbastien edited
https://github.com/llvm/llvm-project/pull/129262
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/matthewbastien updated
https://github.com/llvm/llvm-project/pull/129262
>From 8926756d800b9ecd171b6d645a459b01342e9458 Mon Sep 17 00:00:00 2001
From: Matthew Bastien
Date: Fri, 28 Feb 2025 11:08:25 -0500
Subject: [PATCH 1/2] allow providing debug adapter arguments
---
lldb/
https://github.com/matthewbastien updated
https://github.com/llvm/llvm-project/pull/129262
>From 8926756d800b9ecd171b6d645a459b01342e9458 Mon Sep 17 00:00:00 2001
From: Matthew Bastien
Date: Fri, 28 Feb 2025 11:08:25 -0500
Subject: [PATCH 1/2] allow providing debug adapter arguments
---
lldb/
@@ -75,6 +75,15 @@
"type": "string",
"description": "The path to the lldb-dap binary."
},
+"lldb-dap.arguments": {
+ "scope": "resource",
+ "type": "array",
+ "default": [],
+ "items": {
+"type"
@@ -116,40 +131,31 @@ export class LLDBDapDescriptorFactory
const configEnvironment =
config.get<{ [key: string]: string }>("environment") || {};
const dapPath = await getDAPExecutable(session);
+const dapArgs = getDAPArguments(session);
const dbgOptions
https://github.com/matthewbastien updated
https://github.com/llvm/llvm-project/pull/129262
>From 8926756d800b9ecd171b6d645a459b01342e9458 Mon Sep 17 00:00:00 2001
From: Matthew Bastien
Date: Fri, 28 Feb 2025 11:08:25 -0500
Subject: [PATCH 1/2] allow providing debug adapter arguments
---
lldb/
https://github.com/matthewbastien updated
https://github.com/llvm/llvm-project/pull/128943
>From b9083ea16c7b1dba70cc04acf78f5001f0fb86c6 Mon Sep 17 00:00:00 2001
From: Matthew Bastien
Date: Wed, 26 Feb 2025 11:18:21 -0500
Subject: [PATCH 1/5] add a process picker for attaching by PID
---
lld
@@ -0,0 +1,102 @@
+import { ChildProcessWithoutNullStreams } from "child_process";
+import { Process, ProcessTree } from ".";
+import { Transform } from "stream";
+
+/** Parses process information from a given line of process output. */
+export type ProcessTreeParser = (line: stri
@@ -0,0 +1,38 @@
+import { ChildProcessWithoutNullStreams, spawn } from "child_process";
+import { BaseProcessTree, ProcessTreeParser } from "../base-process-tree";
+
+export class LinuxProcessTree extends BaseProcessTree {
+ protected override spawnProcess(): ChildProcessWithout
https://github.com/matthewbastien edited
https://github.com/llvm/llvm-project/pull/128943
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/matthewbastien updated
https://github.com/llvm/llvm-project/pull/128943
>From b9083ea16c7b1dba70cc04acf78f5001f0fb86c6 Mon Sep 17 00:00:00 2001
From: Matthew Bastien
Date: Wed, 26 Feb 2025 11:18:21 -0500
Subject: [PATCH 1/5] add a process picker for attaching by PID
---
lld
https://github.com/matthewbastien updated
https://github.com/llvm/llvm-project/pull/129262
>From b40c3e7e4ebb154c5f231676451acbd17e1f39f7 Mon Sep 17 00:00:00 2001
From: Matthew Bastien
Date: Fri, 28 Feb 2025 11:08:25 -0500
Subject: [PATCH 1/2] allow providing debug adapter arguments
---
lldb/
https://github.com/matthewbastien updated
https://github.com/llvm/llvm-project/pull/128943
>From b9083ea16c7b1dba70cc04acf78f5001f0fb86c6 Mon Sep 17 00:00:00 2001
From: Matthew Bastien
Date: Wed, 26 Feb 2025 11:18:21 -0500
Subject: [PATCH 1/5] add a process picker for attaching by PID
---
lld
https://github.com/matthewbastien updated
https://github.com/llvm/llvm-project/pull/128943
>From b9083ea16c7b1dba70cc04acf78f5001f0fb86c6 Mon Sep 17 00:00:00 2001
From: Matthew Bastien
Date: Wed, 26 Feb 2025 11:18:21 -0500
Subject: [PATCH 1/5] add a process picker for attaching by PID
---
lld
@@ -0,0 +1,102 @@
+import { ChildProcessWithoutNullStreams } from "child_process";
+import { Process, ProcessTree } from ".";
+import { Transform } from "stream";
+
+/** Parses process information from a given line of process output. */
+export type ProcessTreeParser = (line: stri
https://github.com/matthewbastien created
https://github.com/llvm/llvm-project/pull/129262
Added a new setting called lldb-dap.arguments and a debug configuration
attribute called debugAdapterArgs that can be used to set the arguments used to
launch the debug adapter. Right now this is mostly
@@ -0,0 +1,15 @@
+import { LinuxProcessTree } from "./linux-process-tree";
+
+function fill(prefix: string, suffix: string, length: number): string {
+ return prefix + suffix.repeat(length - prefix.length);
+}
+
+export class DarwinProcessTree extends LinuxProcessTree {
+ protec
@@ -0,0 +1,15 @@
+import { LinuxProcessTree } from "./linux-process-tree";
+
+function fill(prefix: string, suffix: string, length: number): string {
+ return prefix + suffix.repeat(length - prefix.length);
+}
+
+export class DarwinProcessTree extends LinuxProcessTree {
+ protec
https://github.com/matthewbastien updated
https://github.com/llvm/llvm-project/pull/128943
>From b9083ea16c7b1dba70cc04acf78f5001f0fb86c6 Mon Sep 17 00:00:00 2001
From: Matthew Bastien
Date: Wed, 26 Feb 2025 11:18:21 -0500
Subject: [PATCH 01/10] add a process picker for attaching by PID
---
l
@@ -0,0 +1,52 @@
+import * as path from "path";
+import { BaseProcessTree, ProcessTreeParser } from "../base-process-tree";
+import { ChildProcessWithoutNullStreams, spawn } from "child_process";
+
+export class WindowsProcessTree extends BaseProcessTree {
+ protected override sp
https://github.com/matthewbastien updated
https://github.com/llvm/llvm-project/pull/128943
>From b9083ea16c7b1dba70cc04acf78f5001f0fb86c6 Mon Sep 17 00:00:00 2001
From: Matthew Bastien
Date: Wed, 26 Feb 2025 11:18:21 -0500
Subject: [PATCH 01/11] add a process picker for attaching by PID
---
l
https://github.com/matthewbastien edited
https://github.com/llvm/llvm-project/pull/128943
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -146,6 +146,9 @@
"windows": {
"program": "./bin/lldb-dap.exe"
},
+"variables": {
+ "PickProcess": "lldb-dap.pickProcess"
matthewbastien wrote:
Done.
https://github.com/llvm/llvm-project/pull/128943
___
@@ -0,0 +1,52 @@
+import * as path from "path";
+import { BaseProcessTree, ProcessTreeParser } from "../base-process-tree";
+import { ChildProcessWithoutNullStreams, spawn } from "child_process";
+
+export class WindowsProcessTree extends BaseProcessTree {
+ protected override sp
https://github.com/matthewbastien updated
https://github.com/llvm/llvm-project/pull/128943
>From b9083ea16c7b1dba70cc04acf78f5001f0fb86c6 Mon Sep 17 00:00:00 2001
From: Matthew Bastien
Date: Wed, 26 Feb 2025 11:18:21 -0500
Subject: [PATCH 01/13] add a process picker for attaching by PID
---
l
https://github.com/matthewbastien updated
https://github.com/llvm/llvm-project/pull/128943
>From b9083ea16c7b1dba70cc04acf78f5001f0fb86c6 Mon Sep 17 00:00:00 2001
From: Matthew Bastien
Date: Wed, 26 Feb 2025 11:18:21 -0500
Subject: [PATCH 01/12] add a process picker for attaching by PID
---
l
@@ -27,9 +28,14 @@ export class LinuxProcessTree extends BaseProcessTree {
return;
}
+ const command = line.slice(commandOffset, argumentsOffset).trim();
+ if (command === "-") {
matthewbastien wrote:
Added the comment. When `ps` doesn
@@ -65,6 +65,18 @@ This will attach to a process `a.out` whose process ID is
123:
}
```
+You can also use the variable substituion `${command:pickProcess}` to select a
matthewbastien wrote:
Fixed.
https://github.com/llvm/llvm-project/pull/128943
___
@@ -65,6 +65,18 @@ This will attach to a process `a.out` whose process ID is
123:
}
```
+You can also use the variable substituion `${command:pickProcess}` to select a
+process at the start of the debug session instead of setting the pid manually:
+
+```javascript
+{
+ "type
https://github.com/matthewbastien updated
https://github.com/llvm/llvm-project/pull/128943
>From b9083ea16c7b1dba70cc04acf78f5001f0fb86c6 Mon Sep 17 00:00:00 2001
From: Matthew Bastien
Date: Wed, 26 Feb 2025 11:18:21 -0500
Subject: [PATCH 01/14] add a process picker for attaching by PID
---
l
https://github.com/matthewbastien updated
https://github.com/llvm/llvm-project/pull/128943
>From b9083ea16c7b1dba70cc04acf78f5001f0fb86c6 Mon Sep 17 00:00:00 2001
From: Matthew Bastien
Date: Wed, 26 Feb 2025 11:18:21 -0500
Subject: [PATCH 01/15] add a process picker for attaching by PID
---
l
https://github.com/matthewbastien updated
https://github.com/llvm/llvm-project/pull/128943
>From b9083ea16c7b1dba70cc04acf78f5001f0fb86c6 Mon Sep 17 00:00:00 2001
From: Matthew Bastien
Date: Wed, 26 Feb 2025 11:18:21 -0500
Subject: [PATCH 01/16] add a process picker for attaching by PID
---
l
@@ -65,6 +65,19 @@ This will attach to a process `a.out` whose process ID is
123:
}
```
+You can also use the variable substituion `${command:PickProcess}` to select a
+process at the start of the debug session instead of setting the pid manually:
+
+```javascript
+{
+ "type
https://github.com/matthewbastien updated
https://github.com/llvm/llvm-project/pull/129262
>From b40c3e7e4ebb154c5f231676451acbd17e1f39f7 Mon Sep 17 00:00:00 2001
From: Matthew Bastien
Date: Fri, 28 Feb 2025 11:08:25 -0500
Subject: [PATCH 1/6] allow providing debug adapter arguments
---
lldb/
https://github.com/matthewbastien edited
https://github.com/llvm/llvm-project/pull/129262
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -34,6 +34,23 @@ function convertToInteger(value: any): number | undefined {
export class LLDBDapConfigurationProvider
implements vscode.DebugConfigurationProvider
{
+ resolveDebugConfiguration(
+_folder: vscode.WorkspaceFolder | undefined,
+debugConfiguration: vsc
@@ -0,0 +1,42 @@
+import * as path from "path";
+import * as vscode from "vscode";
+import { createProcessTree } from "../process-tree";
+
+interface ProcessQuickPick extends vscode.QuickPickItem {
+ processId: number;
+}
+
+/**
+ * Prompts the user to select a running process.
+
https://github.com/matthewbastien updated
https://github.com/llvm/llvm-project/pull/128943
>From b9083ea16c7b1dba70cc04acf78f5001f0fb86c6 Mon Sep 17 00:00:00 2001
From: Matthew Bastien
Date: Wed, 26 Feb 2025 11:18:21 -0500
Subject: [PATCH 01/11] add a process picker for attaching by PID
---
l
matthewbastien wrote:
> You can go one level beyond this and provide a way to attach to programs
> without needing launch.json configs at all!
>
> 1. Create a new pallete command "attach to process"
> 2. Reuse the same process picker and once the user has selected one item,
> issue a vscode.de
https://github.com/matthewbastien updated
https://github.com/llvm/llvm-project/pull/128943
>From b9083ea16c7b1dba70cc04acf78f5001f0fb86c6 Mon Sep 17 00:00:00 2001
From: Matthew Bastien
Date: Wed, 26 Feb 2025 11:18:21 -0500
Subject: [PATCH 01/17] add a process picker for attaching by PID
---
l
@@ -0,0 +1,48 @@
+import * as path from "path";
+import { BaseProcessTree, ProcessTreeParser } from "../base-process-tree";
+
+export class WindowsProcessTree extends BaseProcessTree {
+ protected override getCommand(): string {
+return "PowerShell";
+ }
+
+ protected overr
@@ -0,0 +1,16 @@
+import { ChildProcessWithoutNullStreams, spawn } from "child_process";
+import { LinuxProcessTree } from "./linux-process-tree";
+
+function fill(prefix: string, suffix: string, length: number): string {
matthewbastien wrote:
Thanks! I didn't kn
@@ -65,6 +65,19 @@ This will attach to a process `a.out` whose process ID is
123:
}
```
+You can also use the variable substituion `${command:PickProcess}` to select a
+process at the start of the debug session instead of setting the pid manually:
+
+```javascript
+{
+ "type
@@ -34,6 +34,23 @@ function convertToInteger(value: any): number | undefined {
export class LLDBDapConfigurationProvider
implements vscode.DebugConfigurationProvider
{
+ resolveDebugConfiguration(
+_folder: vscode.WorkspaceFolder | undefined,
+debugConfiguration: vsc
https://github.com/matthewbastien edited
https://github.com/llvm/llvm-project/pull/128943
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -162,6 +171,13 @@
"type": "string",
"markdownDescription": "The absolute path to the LLDB debug
adapter executable to use."
},
+ "debugAdapterArgs": {
+"type": "array",
+"items": {
+
https://github.com/matthewbastien updated
https://github.com/llvm/llvm-project/pull/129262
>From b40c3e7e4ebb154c5f231676451acbd17e1f39f7 Mon Sep 17 00:00:00 2001
From: Matthew Bastien
Date: Fri, 28 Feb 2025 11:08:25 -0500
Subject: [PATCH 1/4] allow providing debug adapter arguments
---
lldb/
@@ -93,13 +93,33 @@ async function getDAPExecutable(
return undefined;
}
+function getDAPArguments(session: vscode.DebugSession): string[] {
+ // Check the debug configuration for arguments first
+ const debugConfigArgs = session.configuration.debugAdapterArgs;
+ if (
+
https://github.com/matthewbastien edited
https://github.com/llvm/llvm-project/pull/129262
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -137,53 +157,59 @@ export class LLDBDapDescriptorFactory
const dbgOptions = {
env: {
-...executable?.options?.env,
...configEnvironment,
...env,
},
};
-const dbgArgs = executable?.args ?? [];
+const dbgArgs = getDAPArg
@@ -137,53 +157,59 @@ export class LLDBDapDescriptorFactory
const dbgOptions = {
env: {
-...executable?.options?.env,
...configEnvironment,
...env,
},
};
-const dbgArgs = executable?.args ?? [];
+const dbgArgs = getDAPArg
https://github.com/matthewbastien updated
https://github.com/llvm/llvm-project/pull/129262
>From b40c3e7e4ebb154c5f231676451acbd17e1f39f7 Mon Sep 17 00:00:00 2001
From: Matthew Bastien
Date: Fri, 28 Feb 2025 11:08:25 -0500
Subject: [PATCH 1/5] allow providing debug adapter arguments
---
lldb/
@@ -137,53 +157,59 @@ export class LLDBDapDescriptorFactory
const dbgOptions = {
env: {
-...executable?.options?.env,
...configEnvironment,
...env,
},
};
-const dbgArgs = executable?.args ?? [];
matthewbastie
https://github.com/matthewbastien updated
https://github.com/llvm/llvm-project/pull/128943
>From b9083ea16c7b1dba70cc04acf78f5001f0fb86c6 Mon Sep 17 00:00:00 2001
From: Matthew Bastien
Date: Wed, 26 Feb 2025 11:18:21 -0500
Subject: [PATCH 01/20] add a process picker for attaching by PID
---
l
@@ -34,6 +34,23 @@ function convertToInteger(value: any): number | undefined {
export class LLDBDapConfigurationProvider
implements vscode.DebugConfigurationProvider
{
+ resolveDebugConfiguration(
+_folder: vscode.WorkspaceFolder | undefined,
+debugConfiguration: vsc
https://github.com/matthewbastien updated
https://github.com/llvm/llvm-project/pull/128943
>From b9083ea16c7b1dba70cc04acf78f5001f0fb86c6 Mon Sep 17 00:00:00 2001
From: Matthew Bastien
Date: Wed, 26 Feb 2025 11:18:21 -0500
Subject: [PATCH 01/21] add a process picker for attaching by PID
---
l
https://github.com/matthewbastien updated
https://github.com/llvm/llvm-project/pull/128943
>From b9083ea16c7b1dba70cc04acf78f5001f0fb86c6 Mon Sep 17 00:00:00 2001
From: Matthew Bastien
Date: Wed, 26 Feb 2025 11:18:21 -0500
Subject: [PATCH 01/23] add a process picker for attaching by PID
---
l
https://github.com/matthewbastien edited
https://github.com/llvm/llvm-project/pull/129262
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/matthewbastien updated
https://github.com/llvm/llvm-project/pull/129262
>From b40c3e7e4ebb154c5f231676451acbd17e1f39f7 Mon Sep 17 00:00:00 2001
From: Matthew Bastien
Date: Fri, 28 Feb 2025 11:08:25 -0500
Subject: [PATCH 1/7] allow providing debug adapter arguments
---
lldb/
@@ -66,19 +70,17 @@ async function findDAPExecutable(): Promise {
}
async function getDAPExecutable(
- session: vscode.DebugSession,
+ folder: vscode.WorkspaceFolder | undefined,
matthewbastien wrote:
Done.
https://github.com/llvm/llvm-project/pull/129262
matthewbastien wrote:
> I am not sure I understand that concern. Looking at the [commit log of
> swiftlang/llvm-project](https://github.com/swiftlang/llvm-project/commits/next/lldb/tools/lldb-dap),
> it seems that they are picking up changes to lldb-dap very quickly. Or am I
> missing somethin
https://github.com/matthewbastien edited
https://github.com/llvm/llvm-project/pull/129262
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
matthewbastien wrote:
One more thing that crossed my mind: given that the LLDB DAP extension will
automatically be updated to the latest version by VS Code, should we also have
feature flags for things like this in lldb-dap? (or is there some way already
to detect which features are available?
@@ -517,6 +520,16 @@
"cwd": "^\"\\${workspaceRoot}\""
}
},
+ {
+"label": "LLDB: Attach to Process",
+"description": "",
+"body": {
+ "type": "lldb-dap",
+ "request": "atta
77 matches
Mail list logo