[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
Fri Feb 28 11:15:32 PST 2025


================
@@ -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: string) => Process | undefined;
+
+/**
+ * Implements common behavior between the different {@link ProcessTree} implementations.
+ */
+export abstract class BaseProcessTree implements ProcessTree {
+  /**
+   * Spawn the process responsible for collecting all processes on the system.
+   */
+  protected abstract spawnProcess(): ChildProcessWithoutNullStreams;
----------------
matthewbastien wrote:

I normally prefer `spawn()` because you can specify arguments separately, but since we're passing any user input to the spawned process, `exec()` definitely makes more sense to simplify the logic here. Thanks for the suggestion! I've updated the PR.

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


More information about the lldb-commits mailing list