fix: fix pause not breaking after attach without prior breakpoint #86
Merged
CppCXY merged 1 commit intoEmmyLua:masterfrom Apr 29, 2026
Merged
fix: fix pause not breaking after attach without prior breakpoint #86CppCXY merged 1 commit intoEmmyLua:masterfrom
CppCXY merged 1 commit intoEmmyLua:masterfrom
Conversation
…ction routes pause through hitDebugger, which stays null until a breakpoint actually fires.
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.
背景
lua 里有个死循环,想 attach 之后点击 pause 看看堆栈,发现断不下来
问题
attach 之后,如果还没有任何断点被触发过,此时点击 IDE 的 pause 按钮无效,调试器不会停下来。必须先命中过一次断点,pause 才能正常工作。
根因
IDE 的 pause 命令在
EmmyDebuggerManager::DoAction里只对hitDebugger生效,而hitDebugger只在断点真正命中后才被赋值。所以 attach 后未断点过时hitDebugger == nullptr,DoAction(Break)直接静默 return,HookStateBreak装不上去。修复
在
EmmyFacade::Hook进入 lua 处理路径时,若当前没有 hit 的 debugger,就把正在跑 hook 的这个 debugger 登记为hitDebugger。这样首次 pause 也能定位到目标 vm。仅修改emmy_facade.cpp,新增 7 行。