/** * Is a GDB server holding the probe, whoever started it? * * The extension cannot answer this by remembering what it did. An LLM driving * the MCP server starts the GDB server in a *different process* — the one * VSCode spawns for MCP — so the extension host never sees it happen. That is * the whole complaint this exists for: the probe is claimed, nothing in the * UI says so, and the next tool to want it fails in a way that looks like * broken hardware. * * So ask the machine rather than our own memory. A listening GDB port is the * observable fact, and it is true no matter who is responsible. */ export declare function isPortListening(port: number, host?: string, timeoutMs?: number): Promise; /** PIDs listening on a TCP port, excluding our own. */ export declare function findListenerPids(port: number, self?: number): Promise; /** * Pull PIDs out of lsof or netstat output. * * Excluding our own PID is not defensive tidiness. lsof answers with whatever * holds the port, and during development that has already been this very * process — a kill built on "whatever owns the port" would happily take down * the extension host that asked the question. */ export declare function parseListenerPids(output: string, self: number): number[]; /** The command line for a PID, or "" if it cannot be read. */ export declare function processCommandLine(pid: number): Promise; /** * Does this command line belong to a J-Link GDB server? * * Checked before killing anything. A listening port is evidence that * *something* holds it, not that the something is ours — port 2331 could be * any process on the machine, and "it was in the way" is not a reason to end * it. */ export declare function looksLikeGdbServer(commandLine: string): boolean; export interface GdbServerHolder { pid: number; commandLine: string; /** False when something else holds the port — reported, never killed. */ isGdbServer: boolean; } /** Who is holding the GDB port, and is it safe to offer to stop them? */ export declare function findGdbServerHolders(port: number): Promise; export interface GdbStatus { running: boolean; /** True when this extension started it; false means somebody else did. */ startedByExtension: boolean; /** How long we have known it was up, in ms. */ elapsedMs: number; /** * False when it was already running the first time we looked, so the * elapsed time is a lower bound rather than an uptime. */ observedStart: boolean; device?: string; gdbPort: number; rttListening?: boolean; rttPort?: number; } /** "47m", "2h 5m", "12s" — short enough for a status bar. */ export declare function formatDuration(ms: number): string; /** * Compose the bar text and its tooltip. * * Pure, so the wording is testable without a running VSCode. The text stays * short because VSCode truncates a long status bar item and people come to * resent it; everything else goes in the tooltip, which costs no screen space. * * The distinction the text is built around is who started the server. That is * the entire reported complaint in one word: a session you opened is a session * you remember, and one an assistant opened is the one that gets forgotten. */ export declare function renderGdbStatus(st: GdbStatus): { text: string; tooltip: string; }; //# sourceMappingURL=gdb-server-probe.d.ts.map