mirror of
https://github.com/morluto/rea.git
synced 2026-11-12 09:52:27 +00:00
fix(gdb): preserve invalid command configuration errors
This commit is contained in:
1 parent
2aa5ba836d
commit
73ee767656
2 files changed
+13
-1
No files matched your search
@@ -25,6 +25,7 @@ import type {
|
||||
import { DEBUGGER_CONTROL_REPLY_BYTES } from "../domain/analysisResourceLimits.js";
|
||||
import { currentAnalysisOperationSnapshot } from "../domain/analysisOperationSnapshot.js";
|
||||
import { err, ok, type Result } from "../domain/result.js";
|
||||
import { ConfigurationError } from "../domain/configurationErrors.js";
|
||||
import {
|
||||
ProviderProcessSupervisor,
|
||||
spawnOwnedProviderProcess,
|
||||
@@ -1371,6 +1372,7 @@ export class GdbSessionManager {
|
||||
);
|
||||
return ok({ result, evidence });
|
||||
} catch (cause) {
|
||||
if (cause instanceof ConfigurationError) return err(cause);
|
||||
if (cause instanceof AnalysisCancelledError) return err(cause);
|
||||
if (cause instanceof AnalysisCapabilityUnavailableError)
|
||||
return err(cause as AnalysisError);
|
||||
|
||||
@@ -23,6 +23,12 @@ process.stdin.on("data", chunk => {
|
||||
}
|
||||
});`;
|
||||
|
||||
const debuggerDeadlineOverride = {
|
||||
setting: "debugger.command_deadline_ms",
|
||||
action: "set",
|
||||
value: 5000,
|
||||
} as const;
|
||||
|
||||
describe("persistent debugger session managers", () => {
|
||||
let directory: string | undefined;
|
||||
const fixtureOwner = createGdbFixtureOwner();
|
||||
@@ -93,7 +99,7 @@ process.stdin.on("data", (chunk) => {
|
||||
4096,
|
||||
],
|
||||
] as const)(
|
||||
"honors a single override for invalid %s",
|
||||
"restores a GDB session after resetting invalid %s",
|
||||
async (setting, environmentName, value) => {
|
||||
directory = await mkdtemp(join(tmpdir(), "rea-gdb-setting-"));
|
||||
const provider = join(directory, "fake-gdb.mjs");
|
||||
@@ -108,6 +114,10 @@ process.stdin.on("data", (chunk) => {
|
||||
const set = () =>
|
||||
settings.update({ changes: [{ setting, action: "set", value }] });
|
||||
expect(set().ok).toBe(true);
|
||||
if (setting === "debugger.max_command_output_bytes")
|
||||
expect(
|
||||
settings.update({ changes: [debuggerDeadlineOverride] }).ok,
|
||||
).toBe(true);
|
||||
const manager = new GdbSessionManager({
|
||||
spawnProcess: fixtureOwner.spawnProcess,
|
||||
platform: "linux",
|
||||
|
||||
Reference in new issue
Block a user