fix(discovery): report debugger start host restrictions (#7965)

This commit is contained in:
morluto authored and GitHub committed 2026-10-29 09:20:33 +08:00
1 parent 70a8325c38
commit 3536ea2f49
7 files changed
+109 -2

No files matched your search

@@ -1,3 +1,4 @@
import { persistentDebuggerHostSupported } from "../process/PersistentDebuggerHost.js";
import { pcapCaptureHostSupported } from "../domain/pcap/pcapAnalysis.js";
import { describe, expect, it } from "vitest";
@@ -887,6 +888,32 @@ it("keeps independent native sessions discoverable without an unrelated binary t
);
});
it.each(["darwin", "linux", "win32"] as const)(
"reports the persistent debugger start host restriction on %s",
(platform) => {
const entries = buildCapabilityInventory(status(), {
...enabledPolicy,
hostUnsupported: {
persistentDebugger: !persistentDebuggerHostSupported(platform),
},
});
for (const name of ["start_gdb_session", "start_rizin_debug_session"])
expect(entries.find((entry) => entry.name === name)).toMatchObject(
platform === "linux"
? { available: true, reason: "available" }
: {
available: false,
reason: "unsupported_host",
remediation: expect.stringContaining("Linux"),
},
);
for (const name of ["gdb_session_status", "close_rizin_debug_session"])
expect(entries.find((entry) => entry.name === name)).toMatchObject({
available: true,
});
},
);
describe("summary tool availability", () => {
it("summarizes every tool's current availability without static catalog flags", () => {
const full = buildCapabilityInventory(status(), enabledPolicy);
+8
View File
@@ -71,6 +71,7 @@ export const HOST_RESTRICTED_FEATURES = [
"firmwareInspection",
"firmwareExtraction",
"javascriptRecovery",
"persistentDebugger",
] as const;
export type HostRestrictedFeature = (typeof HOST_RESTRICTED_FEATURES)[number];
@@ -444,6 +445,13 @@ const workflowAvailabilityFor = ({
kind,
policy,
}: AvailabilityContext): Availability | null => {
if (name === "start_gdb_session" || name === "start_rizin_debug_session")
return hostRestrictedAvailability(
policy,
"persistentDebugger",
true,
"Run persistent debugger sessions on Linux with /proc descriptor readback.",
);
if (
name === "inspect_desktop_application" ||
name === "inspect_go_binary" ||