Repository navigation
WIP: feat(debugger): WP-3 consult wiring — session stops at entry and breakpoints (1.5.0) - #1878
Merged
Merged
Conversation
…at breakpoints (1.5.0) Part 1 (integration): the 150-c session-core skeleton needed no port — it is already on master (58e24bf), byte-identical to the 150-c branch for breakpoints.rs/event.rs/gate.rs/session.rs, with mod.rs strictly ahead (the -D warnings facade allows). Verified on this tree: the 39 skeleton tests pass and the lib baseline is unchanged (773/1/1, failure = ownership_unary_operators only). Part 2 (WP-3 wiring, per DESIGN-FINAL sections 4/5/6 and the 150-c REPORT section 5 notes): - debugger/driver.rs (new): SessionDriver pairs a DebugSession with a frontend StopLoop; gate pairing lives with the driver (activate at install, deactivate at termination/detach). - The funnel (executor/trap_exec.rs run_debug_trap) takes a SeamKind and consults the session: the SESSION_ACTIVE gate is loaded before the trap-action lookup (note 1), the entry stop is served at the first funnel arrival as an already-established stop (DE-01/G-08, note 4), the no-action early return still consults (G-03), and the extdebug veto precedes the consult (design 4.2 order). All 11 funnel call sites pass their kind; the main seam's Conditional/Arithmetic distinction comes from the node's own fields (note 8). - Admission widened for attached sessions at the main seam, the function-entry seam, the arithmetic-for clauses, and the case head — a session's scope is the attachment, not the functrace inheritance the trap path checks. Child executors never carry a driver (DE-12 stays a later package). - The consult does the breakpoint accounting of note 3: register_hit (ignore before condition) -> condition evaluated through the engine itself in the current frame under the re-entrancy guard (design 5.3) -> commit_conditional_stop; stepping predicates for StepInto/StepOver are evaluated at the seam; Finish is evaluated at the return site. - DE-04: frame returns are emitted at the function return site for the Completed / EntrySkipped / EntryForceReturn routes, with the status the caller will observe. - DE-07: an asynchronous stop is serviced at the boundary poll (run_pending_signal_traps), after signal-trap dispatch (note 5). - DE-09: the session learns the final status from the finish side only — finish_shell and the exit builtin's dispatch — never from the EXIT funnel (note 6); the first speaker wins. - Executor gains a debug_driver field (None in both struct literals: init and the command-substitution child). P-1 adjudicated before landing DE-04 (GNU 5.3.20 oracle, script files; C source execute_cmd.c:5383-5407 execute_function): an entry-skipped frame returns the DEBUG trap's status and never fires the RETURN trap. The suppression already held observationally; the status did not — a skipped call returned 0 for trap statuses 1/3/127. The fix carries the funnel's Some(status) to the call's result and guards the RETURN-trap site with the skip, making the site match the C shape; the old comment claiming EXECUTION_SUCCESS for this seam was corrected (that rule is execute_cmd.c:4510, the simple-command seam). Six behavior pins (p1_*) assert the GNU outcomes; on pristine master the two skip pins fail on the status assertion, on this branch the full 8-probe matrix matches the oracle byte-for-byte. Tests: 14 new tests in debugger::wiring_tests (DE-01/02/03/04/ 07/09 acceptance + detach + 6 P-1 pins). Lib: 787 passed / 1 failed / 1 ignored — the failure set equals the tree baseline. diffcorpus 306: 305 pass, sole failure ps06 adjudicated a timing flake (isolated re-runs flip on the pristine binary too; ms10 passed). cargo check --lib with -D warnings is clean.
caomengxuan666
marked this pull request as ready for review
October 27, 2026 14:48
caomengxuan666
added a commit
that referenced
this pull request
Oct 27, 2026
WIP: test(debugger): quote sourced-script path in wiring tests — clears #1878 goldens red (8 wiring tests)
SpookyWaste
pushed a commit
to SpookyWaste/rubash
that referenced
this pull request
Oct 29, 2026
The 8 debugger::wiring_tests that have failed only in the Windows goldens job since unixwin#1878 all drive the debuggee through sourced_script(), which interpolated the temp script's native path into the driver input unquoted: `. C:\Users\...`. In a bare word the lexer treats `\` as an escape, every separator was eaten, `.` never found the file, and each debuggee exited status 1 having executed nothing (de01's status assertion at wiring_tests.rs:142 — left 1, right 0). Quote the path at the helper, the single interpolation point all nine call sites share — the same harness shape the api consumer tests were fixed with in unixwin#1883. No product code changes; the debuggee scripts and their status semantics are untouched.
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.
WIP: 1.5.0 WP-3 起步 — session-core 集成核实 + consult 接线(簇 150-wiring)
第一段:集成(核实结论:无需搬运)
150-c 的 session-core 骨架已在 master 上(
feat150/slice-session-core线已合并):src/debugger/的breakpoints.rs/event.rs/gate.rs/session.rs与 150-c 分支逐字节一致,mod.rs仅多一处-D warningsfacade allow(master 更靠前),src/lib.rs的模块声明在位。本簇在当前 master(58e24bf6)实测:骨架 39 测全绿、lib 基线 773/1/1 不回退(唯一失败 =ownership_unary_operators_check_existing_file,与该树基线全等)。第二段:WP-3 接线(按 DESIGN-FINAL §4/§5/§6 与 150-c REPORT §5 八条注记)
src/debugger/driver.rs):SessionDriver=DebugSession+ 前端StopLoop;门控配对归驱动层(安装时activate()、终止/脱离时deactivate(),注记 7)。run_debug_trap加SeamKind参数,11 个调用点各传其 kind;主接缝的 Conditional/Arithmetic 由节点字段区分,注记 8):SESSION_ACTIVE门控在 trap 动作查表之前加载(注记 1);入口停点在首次漏斗到达时按既成停点服务(DE-01/G-08,注记 4,不另造武装旗);无动作早退路径同样 consult(G-03);extdebug 否决先于 consult 决定(设计 §4.2 顺序——被否决的单元既不执行也不停车)。debug_driver: None,DE-12 合成帧内不停。register_hit(先扣 ignore、后评条件)→ 条件用引擎自身在当前帧求值(重入卫士覆盖,设计 §5.3)→commit_conditional_stop提交;StepInto/StepOver 谓词在接缝求值,Finish 在返回点求值。FrameReturned(Completed/EntrySkipped/EntryForceReturn 三路),状态为调用方将观察到的状态。run_pending_signal_traps)信号 trap 分发之后服务(注记 5)。finish_shell+exit内建分发点,不挂 EXIT 漏斗(注记 6),先到者胜、幂等。P-1 定谳(先钉后落 DE-04)
GNU 5.3.20 oracle 脚本文件探针 + C 源码
execute_cmd.c:5383-5407(execute_function):入口 skip 的帧返回 DEBUG trap 的状态且不发 RETURN trap。实测分歧只有状态一半:pristine master 对状态 1/3/127 的 skip 一律返回 0(抑制一半在全部探针形状上已成立)。修复 = 漏斗Some(status)贯通到调用结果 + 返回点按 skip 守卫(与 C 形对齐);旧注释「函数调用状态为 EXECUTION_SUCCESS」系误读(那是execute_cmd.c:4510简单命令接缝的规则),已更正。6 条p1_*行为钉断言 GNU 结果:pristine 上两条 skip 钉在状态断言上失败,本分支 8 探针矩阵与 oracle 逐字节一致。验收证据
debugger::wiring_tests:DE-01/02/03/04/07/09 + detach + 条件断点 + 6 条 P-1 钉),全绿;debugger::共 53 测绿。cargo check --lib带-D warnings干净(niu CI 面);改动文件逐个 rustfmt(存量漂移 hunk 已剔除不带入);CR=0。Refs #497(调试器定版;本 PR 是其 WP-3 起步,不关闭)