Repository navigation
feat(debug): #1210 内置汇编级调试:反汇编、指令步进、指令断点、寄存器与只读内存 - #1527
Merged
Merged
Conversation
xiaoyumuxi
marked this pull request as ready for review
October 27, 2026 06:51
Lithe Review结论: ⛔ 有阻塞 Findings
Scope Check
Suggestions
SummaryRust Core 的能力快照、请求边界、引用长度/读取大小限制、过期操作保护和 Swift bridge 的整体方向与 DAP 适配边界一致,新增测试和共享契约覆盖面也较大。当前不能通过审查的明确原因是新增 Debug UI 大量直接硬编码用户可见字符串,尽管同一 PR 已添加对应共享 i18n 词条;这会直接造成语言选择不一致,按规则属于 P1。Windows 功能和若干高频交互仍缺少真实运行证据,但属于非阻塞验证缺口。 Verification
|
Collaborator
Author
xiaoyumuxi
added a commit
that referenced
this pull request
Oct 27, 2026
Integrate the disassembly debugging branch with preview at cdeec19. Preserve both the Java transport notes and optional native-debug notes when resolving their documentation conflict.
内核按适配器能力开放汇编级调试,插件只负责启动 lldb-dap/gdb 等适配器;能力快照 supported = 适配器声明 ∧ 已注册扩展 ∧ 已授权。 - 无源码栈帧:栈帧不伪造文件和第 1 行,显示函数名与地址,暂停后自动打开反汇编 - 反汇编:debug.inspect disassemble 与反汇编视图,高亮当前指令,保持最小滚动,剩余不足时向后续读 - 指令步进:debug.execute 增加 granularity,仅适配器声明 supportsSteppingGranularity 时生效;反汇编打开时步过/步入按指令前进,面板头部与按钮提示同步变化,不支持时提示仍按源码行前进 - 指令断点:debug.setInstructionBreakpoints,点击地址栏设置或移除;只属于当前会话,不持久化、不重放 - 寄存器:作用域 presentationHint registers 显示为寄存器标签;宿主不内置 CPU 寄存器表 - 内存:debug.inspect readMemory,接受地址或保存着地址的表达式,从目标前 64 字节读起并分页;目标字节在十六进制和 ASCII 两侧高亮并滚入可见区;右侧显示设置可切换进制、每格字节数、每行字节数、字节序与 ASCII 列;读不到的字节显示为缺失;只读,不开放 writeMemory - 单步局部刷新:next/stepIn/stepOut/stepBack 保留现有检查数据并原地替换,线程、调用栈、变量、反汇编、内存与 JSON 视图不再整面板清空,变化的内存字节被标出;继续、暂停、结束才清空 - 变量 JSON 视图:修复顶部空白带,key/value 分色高亮 - i18n:新增词条走 shared/i18n 并生成;功能矩阵新增 debug-disassembly(Windows 待实现);设计笔记补充真实 lldb-dap 验证结论
…tion Freeze the old variable tree before the next stop reloads scopes and keep inspection controls read-only until replacement. Retire disassembly and memory callbacks before synchronous cancellation, and reject stale disassembly retries after session changes. Clear retained inspection when transport fails or the session terminates. Label memory offsets relative to the requested reference, use shared text-input and font owners, and update the owning decision note and platform verification steps. Add four deterministic regressions reproduced against the original PR. Validation: 152 selected Swift tests and 72 Rust debug tests passed; i18n, shared contracts, platform boundaries, test stability, Agent Notes, matrix gates and runtime bundle immutability passed. Real GUI and Windows runtime validation remain pending.
xiaoyumuxi
force-pushed
the
feat/1210-disassembly-debugging
branch
from
October 27, 2026 12:28
ee56e96 to
a89477e
Compare
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.

概述
#1210 在统一调试内核里内置汇编级调试:反汇编、按指令单步、指令断点、寄存器与只读内存。插件仍然只负责启动
lldb-dap/gdb之类的适配器,这些功能是否可用完全由适配器声明的能力决定,宿主不按适配器 ID 分支。能力快照规则:
supported = 适配器声明 ∧ 已注册扩展 ∧ 已授权。适配器没声明的能力,界面上对应的标签、按钮、gutter 交互都不出现。功能点
A. 无源码栈帧
B. 反汇编(
debug.inspectkind=disassemble)C. 按指令单步(
debug.execute新增可选granularity)supportsSteppingGranularity时生效。D. 指令断点(
debug.setInstructionBreakpoints)supportsInstructionBreakpoints时,点击反汇编地址栏设置 / 移除断点。E. 寄存器与内存
presentationHint: "registers"显示在独立的“寄存器”标签;宿主不内置 CPU 寄存器表。debug.inspectkind=readMemory):接受地址或保存着地址的表达式,从目标地址前 64 字节读起,可向前 / 向后分页;读取失败回退为从目标地址读起;读不到的字节显示为缺失而不是00。writeMemory没有开放(适配器虽声明支持,但扩展未注册,supported = false)。连续单步只局部刷新
next/stepIn/stepOut/stepBack期间保留当前检查数据,只读置灰,收到stopped后按线程 → 栈 → 作用域 → 变量的顺序原地替换,变量展开状态按名称路径恢复。变量 JSON 视图
其他
shared/i18n/补齐中英文并重新生成,没有手改生成文件,也没有放宽检查脚本。debug-disassembly,macOS 已实现(验证待定),Windows 未实现。optional-debug-extensions、unified-debug-engine-and-adapter-registry)补充了这些能力的设计原因,以及真实 Xcodelldb-dap的验证结论。shared/contracts/rust-core-api.md、shared/fixtures/debug/projection-v2-examples.json(及 proposals 下的同内容草稿)同步更新。平台状态
debug.inspect的disassemble/readMemory,待 React 界面接入,功能矩阵里标为 missing。验证
./scripts/verify-rust-core.sh:通过(Rust 测试 1260 + 集成,Swift 桥接、符号链接与 Git 集成)。./scripts/test-macos.sh --filter调试相关用例:133 个通过,其中新增 12 个覆盖单步原地刷新、按指令单步、反汇编保留与内存变化标记。node scripts/generate-i18n.mjs --check、node scripts/verify-app-language-localization.mjs、verify-agent-notes、verify-shared-contracts、verify-test-stability、verify-runtime-bundle-immutability、verify-platform-feature-matrix:通过。./scripts/verify-platform-feature-matrix-change.sh origin/preview HEAD:通过。lldb-dap探测(脚本直接走 DAP):granularity: instruction让 PC 在同一源码行内前进一条指令(arm64 上 +4 字节),granularity: line则移到下一行。没有在真实应用里亲眼确认的部分
lldb-dap探测,建议评审时手动点一遍。-g)的程序在进入main之前没有可暂停的位置,指令断点需要先用行断点暂停后再在反汇编里设置。已知事项
Review 修复(a89477e12)
c3bd66909,移除中间 merge 提交;PR 仅保留功能提交604a6c658与修复提交a89477e12。已确认 rebase 前后完整文件树逐字节一致,功能与修复内容没有丢失,并以精确--force-with-lease更新分支。Rebase 验证