Repository navigation
feat(debugger): session-core skeleton — gate, breakpoint table, DebugEvent catalogue, session state machine (WP-2 first half) - #1576
Merged
Conversation
WP-2 first slice: src/debugger/ enters the tree as a crate-internal module (the split freezes the public candidate surface; the module widens when it moves to its core home). The gate flag is the design section 4.4 session AtomicBool whose definition WP-1 gap G-02 was waiting for: one atomic load is the whole debugger-off cost.
Design section 5 in one table: line, function, and the two watch kinds share the fixed entry field set (id, kind, target, enabled, ignore count, hit count, optional condition, optional command list, one-shot). Conditions are an orthogonal field, not a fifth kind; function entries start pending; watch entries carry their previous-stop snapshot for stop-and-diff. Hit accounting lives in the table: disabled counts nothing, ignore credit is spent before conditions are consulted, and a one-shot entry is deleted at its committed stop — a false condition verdict commits nothing.
The WP-1 catalogue DE-01..=DE-12 as the session-owned typed event stream, with the seam kind tags of the catalogue section 4 driving stepping filters and fixture attribution (not admission tiers). Stop payloads carry the stop point command text from the same frozen source the trap path reports (WP-1 pin P-3); frame returns are their own event including the entry-skipped and entry force-returned bypass routes. Job completion and pipeline status stay rendered inspection data, not events.
Stopped(entry) / Running / Terminated with the design section 6 arming recorded as data (Continue / StepInto / StepOver / Finish; the predicates that evaluate an arming against a live seam are the stepping work package). Transitions queue their own events, the entry stop is the second half of DE-01, and the asynchronous stop flag of gap G-07 is set-only from the signal side and consumed exactly once at the boundary poll. State transitions are pure: gate activation is an explicit driver step, so the machine is testable without touching process state.
Member
Author
集成验证账(集成树
|
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.
1.5.0 计划 WP-2 前半:
src/debugger/session-core 骨架Refs #595
Refs #497
(两条均为 1.5.0 实施目标,保持 open;本 PR 不关单。)
PLAN 行 3(WP-2 session core)的前半落地:调试器 session 核心的纯数据层骨架。零 executor 接触——未接 consult、未改任何 seam、未动既有文件;模块以
pub(crate)声明(沿仓内fd先例),拆分期不扩公共面,待行 4 整体搬家时再放宽为 core 的公共面。内容(6 文件,+1925/−0)
src/lib.rs:+1 行pub(crate) mod debugger;src/debugger/mod.rs:模块文档与再导出;钉住三条无依赖纪律(无终端、无平台设施、不反向依赖 executor 内部)src/debugger/gate.rs:门控旗GateFlag/SESSION_ACTIVE(定版 §4.4;WP-1 缺口 G-02 的定义方——在 trap 动作 consult 之前被查,关时成本 = 一次原子加载)src/debugger/breakpoints.rs:断点表数据模型(定版 §5):四种 kind(行 / 函数 / watch / watche;条件为正交字段非第五种)、核验语义(Verified / Unverified 带理由 / Pending)、命中账序(ignore 先于条件、one-shot 在条件真提交时才消费)、watch 的 stop-and-diff(双 epoch 优先于渲染比对)src/debugger/event.rs:类型化事件流,按 WP-1 事件目录 DE-01…DE-12 逐项建模;Stopped一变体承载 DE-02/DE-03、靠 seam 区分;FrameReturn的四条返回路线(含入口被 skip、入口 force-return 两条旁路)为一等公民src/debugger/session.rs:session 状态机(入口停点为初始态,定版 §14 Q1 裁定 (a))、事件队列、异步停旗(信号侧只置旗、边界轮询消费且只消费一次)纪律自查(簇侧 + 集成侧双验)
src/debugger/的use只有std与模块内super::互引;禁表面(std::io/std::process/libc/ 平台与终端设施)零命中WP-3 接线注记
见簇报告 §5,要点:漏斗早退是第一约束(
trap_exec.rs:978-985无动作路径上 consult 同样要被询问,G-03);P-1(入口 skip 时 RETURN trap 抑制)先以行为钉定谳再落 DE-04(G-04);DE-09 挂驱动/分发收尾侧而非只挂 trap 漏斗(G-13);门控的 activate/deactivate 配对归驱动层,状态迁移刻意不碰全局旗。验证结果在本 PR 评论区补账(集成树、净化环境、门控构建)。