[Lldb-commits] [lldb] [lldb-dap] Add process picker command to VS Code extension (PR #128943)

Matthew Bastien via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 6 13:43:45 PST 2025


================
@@ -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.
+ *
+ * The return value must be a string so that it is compatible with VS Code's
+ * string substitution infrastructure. The value will eventually be converted
+ * to a number by the debug configuration provider.
+ *
+ * @returns The pid of the process as a string or undefined if cancelled.
+ */
+export async function pickProcess(): Promise<string | undefined> {
----------------
matthewbastien wrote:

I really like this idea! I've added a filter to the process picker if the `program` is also set.

As a side note: I hadn't actually anticipated setting both `pid` and `program` at the same time. I accidentally left the `program` property in my example launch configuration.

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


More information about the lldb-commits mailing list