Repository navigation
WIP: fix(debugger): breakpoint conditions report once, cannot kill the debuggee, consult-line diagnostics (#1962) - #1979
Merged
Conversation
…uggee, diagnostics carry the consult line (rubash#1962) Design: docs/design/debugger-full-design.md 5.3 (a condition that errors is treated as false and reported once per breakpoint), 9.5/10 (source command files as the batch driver). GNU convention: evalstring.c parse_and_execute numbers a nested string from the caller's line; the condition re-parse now does the same from the consult line. - driver: StopLoop::announce outlet plus SessionDriver::announce_condition_error. The note_condition_error record previously had no reader at all: its first-failure bool was discarded at the only call site, so failures were ledgered but never reported (audit cells 1 and 5). - trap_exec evaluate_debug_condition: snapshot and restore the whole evalerror family, the nounset DISCARD latch, and the break-failure status around the evaluation. A fatal arm the condition raises against its own list (break 1 2 arming the too-many-arguments DISCARD) reclassifies the evaluation as failed instead of leaking into the debuggee's abandon checks, where it silently terminated the program while the session exited 0. The evaluation's stderr is captured (the pipeline-stage capture mechanism): replayed as-is on a true/false verdict, quoted once inside the report on a failure, so a failing condition's diagnostic no longer sprays per hit. The condition text is re-parsed on the consult line, so its diagnostics name the debuggee's file at the line whose consult raised them (was: the condition's own line 1). - cli: announce renders at the consult; new `source <file>` batch command (design 10) with a stack-ordered command queue that survives across stops. - dap: announce rides the console output channel (the watch banner's channel). - cli_tests: 10 regression pins (the three confirmed cells, the three overturned cells as parity pins, the source command).
The pin embedded dir.join("ticks") verbatim into the break
condition. On Windows that string carries backslash separators,
and the condition is re-tokenized by the shell lexer
(evaluate_debug_condition), where a backslash in an unquoted word
is the escape character: the redirect target was dequoted to a
separator-stripped namesake, so the ticks landed in the wrong
file and the read-back panicked NotFound. The product side is
not at fault: a Linux reproduction with the Windows spelling
shows the debuggee completing all consults and exactly three
ticks in the mangled-name file, one per consult. Use the
shell-facing forward-slash spelling, the convention every other
shell-text path embedding in the test tree already follows
(e.g. tests/cli_tests.rs source operands). Assertion unchanged:
exactly three ticks, one per consult.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RC audit phase-2 (B-face cell group ②) fix for the three confirmed debugger breakpoint-condition defects. Design basis: docs/design/debugger-full-design.md §5.3 (failed condition = false + reported once per breakpoint), §9.5/§10 (
sourcecommand files); GNU evalstring.c caller-line numbering for the re-parse.What changed:
note_condition_erroronly wrote a HashSet whose first-failure bool its sole caller discarded — no frontend ever read the record. NewStopLoop::announce+SessionDriver::announce_condition_error: CLI renders at the consult, DAP rides the console output channel.evaluate_debug_conditionnow snapshots/restores the whole evalerror family + nounset latch + break-failure status; a fatal arm the condition raises against its own list (break 1 2's too-many-arguments DISCARD) reclassifies the evaluation as failed instead of leaking into the debuggee's abandon checks (previously: debuggee silently died after iter 1, session exit 0).sourcebatch command — implemented (stack-ordered queue across stops), not a design-doc change.sourcecommand.Gates (local, Linux same-machine): -D warnings check clean; lib 914/1/3 vs pristine 904/1/3 (delta = exactly the 10 new pins, failure set identical); regression 171/4/1 with all 4 failures environmental (2 missing vendored .sub fixtures ENOENT, readdir-order flake, HOME-sensitive) matching the recorded pristine signature; diffcorpus 305/306 (sole failure bi08, adjudicated flake, 3/3 isolated passes); PTY six-cell re-verification byte-level in the fix report. Windows CI (goldens) is the merge gate.
Fixes #1962