Skip to content

修复移除断点后 Continue 仍命中旧断点的问题#349

Merged
actboy168 merged 2 commits intomasterfrom
fix/breakpoint-waitverify-stale-hit-cn-pr
Apr 27, 2026
Merged

修复移除断点后 Continue 仍命中旧断点的问题#349
actboy168 merged 2 commits intomasterfrom
fix/breakpoint-waitverify-stale-hit-cn-pr

Conversation

@sumneko
Copy link
Copy Markdown
Collaborator

@sumneko sumneko commented Apr 27, 2026

背景

在命中断点后,如果在暂停状态把该断点移除,再点击 Continue,调试器仍会继续命中这个已经删除的断点。

client.log 可见关键时序:

  • 先收到 setBreakpoints(..., breakpoints: [])
  • 紧接着 Continue 后出现 breakpoint changed (id:1, verified:true)
  • 随后再次 stopped (hitBreakpointIds:[1])

这说明被删除的断点在运行过程中被重新激活了。

根因

worker 端在 set_bp 中如果已经能解析到 srcarray,会更新 currentactive,但不会同步清理 waitverify[bpClientKey]

当后续有新 proto 加载时,newproto 会优先读取残留的 waitverify,从而把旧断点重新 verify 并重新加入 hook,导致已删除断点“复活”。

修复

set_bpsrcarray 分支完成处理后,补充:

  • 清理 waitverify[bpClientKey(clientsrc)]
  • 调用 updateHook() 同步 hook 状态

这样后续 newproto 将依据最新的 currentactive,不会再从过期 waitverify 复活已删除断点。

额外说明

本次提交按要求移除了新增代码注释,仅保留必要逻辑变更。

Copilot AI review requested due to automatic review settings April 27, 2026 14:28
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

该 PR 修复调试器在暂停状态移除断点后,继续执行(Continue)仍会命中已删除断点的问题;核心是防止 worker 端残留的 waitverify 在后续 newproto 时把旧断点重新 verify 并重新挂钩,导致断点“复活”。

Changes:

  • set_bpsrcarray 分支处理完成后,清理对应的 waitverify 条目,避免旧断点残留被后续流程重新激活
  • 补充调用 updateHook(),使 hook 开关状态与最新的断点集合及时同步

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies the breakpoint management logic in extension/script/backend/worker/breakpoint.lua. Specifically, it ensures that the waitverify state for a client is cleared and the debug hook is updated once breakpoints are processed. I have no feedback to provide as no review comments were submitted for evaluation.

@actboy168 actboy168 merged commit 6ee2795 into master Apr 27, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants