================
@@ -0,0 +1,101 @@
+import { execFile } from "node:child_process";
+import { promisify } from "node:util";
+
+/** Represents a single process running on the system. */
+export interface Process {
+ /** Process ID. */
+ id: number;
+
+ /** Command that was used to start the process. */
+ command: string;
+
+ /** The full command including arguments that was used to start the process.
*/
+ arguments: string;
+}
+
+export interface ProcessTree {
+ listAllProcesses(): Promise<Process[]>;
+}
+
+/**
+ * Options passed to {@link LldbDapProcessTree} to target a specific platform.
+ */
+export interface LldbDapProcessTreeOptions {
+ /** Name of the LLDB platform to select (e.g. "host", "remote-linux"). */
+ platformName?: string;
+ /** URL to connect the platform to, for remote platforms. */
+ platformUrl?: string;
+}
+
+/**
+ * Runs a command and captures its stdout. Abstracted so tests can inject a
+ * stub without spawning a real process.
+ */
+export type ExecFn = (exe: string, args: string[]) => Promise<{ stdout: string
}>;
----------------
da-viper wrote:
The `execfn` can also fail if the platform url is wrong and we will silently
fail. we need the stderr too.
https://github.com/llvm/llvm-project/pull/197513
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits