Repository navigation
feat(debug): #1794 静音覆盖全部断点类型、内存读取窗口与标题栏运行/调试判断下沉到 Core - #21
Merged
Merged
Conversation
…memory window and decide title bar run/debug presses - debug.setBreakpointsMuted keeps the stored sets and sends every kind (source, exception, function, instruction, data) empty while muted; a child session starts muted when its parent is. - debug.planMemoryWindow / debug.locateMemoryWindow own the memory view's readMemory window: numeric addresses aligned to 64 bytes, opaque references read as given, and where the highlighted byte falls in the reply. - runConfig.decideTitleAction decides what a title bar Run or Debug press does from the facts the host reports, so a failed model load ends instead of looping. - Fixtures: rust/fixtures/debug/memory-window-v1.json, rust/fixtures/run-configuration/title-action-v1.json.
17 of 24 tasks
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.
背景
Lithe-IDEA #1837(标题栏运行/调试按钮、IntelliJ IDEA 样式的调试工具窗口)的评审意见指出三处问题:
按 develop-lithe 的逻辑归属,三者都放进 Core,桌面端只负责传输和呈现。
改动
debug.setBreakpointsMuted { sessionId, muted }(debug/engine.rs、debug/types.rs)breakpoints_muted。静音期间 Core 照常保存、接受替换源码/异常/函数/指令/数据五类断点,但发给适配器的每一类都是空集合,所以适配器哪里都不停。initialized之后)只重发含有启用项的类别,源码按路径逐个重发;重复设置同一状态不发任何帧。startDebugging)创建时继承父会话的静音状态。send_*_breakpoints的过滤统一走sends(enabled)。muting_empties_every_breakpoint_kind_and_children_inherit_it:异常过滤器、函数、指令、源码都被清空;再次静音不发帧;静音时替换函数集合仍发空集合;子会话继承;取消静音按保存的集合恢复。debug.planMemoryWindow/debug.locateMemoryWindow(新文件debug/memory_window.rs)plan:地址去首尾空白后校验(非空、≤256 字符、无控制字符)。按 DAP 写法识别数字地址(0x十六进制或十进制):显示为小写0x,从不大于它的 64 字节边界开始读 1024 字节,这样 8/16/32/64 字节每行时目标字节都落在正确的列。其他引用不透明:原样读取,offset 为 0,不做解析。locate:带回窗口原样(不匹配则拒绝)和回复的address、字节数,返回{ base?, mark? }。base是首字节地址(小写0x),mark是目标字节下标;回复不包含目标字节时省略。rust/fixtures/debug/memory-window-v1.json(6 个场景:十六进制、十进制、大写前缀与补零、不透明引用、地址 0、u64::MAX)。runConfig.decideTitleAction(新文件execution/title_action.rs){ action, trigger, currentFileChosen, settled, configuration? },configuration为unsupported/instanceMissing/modelNotLoaded{failed}/modelLoaded{debuggable}。currentFile/wait/loadModel/unsupported/targetMissing/modelFailed/run/debug/notDebuggable。settled时再次失败返回modelFailed,不会循环。rust/fixtures/run-configuration/title-action-v1.json(14 个用例,带 run-configuration fixture 要求的version/expected)。protocol/command.rs(含命令名测试列表)、runtime/dispatcher.rs、debug/mod.rs、execution/mod.rs。rust/contracts/rust-core-api.md:在断点、运行配置、新的 “Memory window” 小节补充三处说明。验证
cargo test -p lithe-core:1748 passed。cargo clippy -p lithe-core --all-targets:新增文件没有告警。scripts/rust-core/verify-rust-core-comments.sh通过(唯一的 rustdoc 警告在plugins/capabilities.rs,改动前就有)。消费者
PINNED_CORE_REVISION升到本 PR 的 commit,并把静音、内存窗口、标题栏判断切到这三个命令;fixture 已同步到shared/fixtures/。本 PR 若 squash 合并,#1837 需要再把固定版本升到合并后的 commit。