Skip to content

Commit 0a615f2

Browse files
add lldb-dap.attachToProcess command
1 parent f84f5cc commit 0a615f2

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

lldb/tools/lldb-dap/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,11 @@
556556
}
557557
],
558558
"commands": [
559+
{
560+
"command": "lldb-dap.attachToProcess",
561+
"title": "Attach to Process...",
562+
"category": "LLDB DAP"
563+
},
559564
{
560565
"command": "lldb-dap.pickProcess",
561566
"title": "Pick Process",
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import * as vscode from "vscode";
2+
3+
export async function attachToProcess(): Promise<boolean> {
4+
return await vscode.debug.startDebugging(undefined, {
5+
type: "lldb-dap",
6+
request: "attach",
7+
name: "Attach to Process",
8+
pid: "${command:pickProcess}",
9+
});
10+
}

lldb/tools/lldb-dap/src-ts/extension.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
} from "./debug-adapter-factory";
88
import { DisposableContext } from "./disposable-context";
99
import { LLDBDapConfigurationProvider } from "./debug-configuration-provider";
10+
import { attachToProcess } from "./commands/attach-to-process";
1011

1112
/**
1213
* This class represents the extension and manages its life cycle. Other extensions
@@ -48,6 +49,12 @@ export class LLDBDapExtension extends DisposableContext {
4849
this.pushSubscription(
4950
vscode.commands.registerCommand("lldb-dap.pickProcess", pickProcess),
5051
);
52+
this.pushSubscription(
53+
vscode.commands.registerCommand(
54+
"lldb-dap.attachToProcess",
55+
attachToProcess,
56+
),
57+
);
5158
}
5259
}
5360

0 commit comments

Comments
 (0)