Skip to content

fix: fix pause not breaking after attach without prior breakpoint #86

Merged
CppCXY merged 1 commit intoEmmyLua:masterfrom
sssooonnnggg:master
Apr 29, 2026
Merged

fix: fix pause not breaking after attach without prior breakpoint #86
CppCXY merged 1 commit intoEmmyLua:masterfrom
sssooonnnggg:master

Conversation

@sssooonnnggg
Copy link
Copy Markdown
Contributor

@sssooonnnggg sssooonnnggg commented Apr 28, 2026

背景

lua 里有个死循环,想 attach 之后点击 pause 看看堆栈,发现断不下来

问题

attach 之后,如果还没有任何断点被触发过,此时点击 IDE 的 pause 按钮无效,调试器不会停下来。必须先命中过一次断点,pause 才能正常工作。

根因

IDE 的 pause 命令在 EmmyDebuggerManager::DoAction 里只对 hitDebugger 生效,而 hitDebugger 只在断点真正命中后才被赋值。所以 attach 后未断点过时 hitDebugger == nullptrDoAction(Break) 直接静默 return,HookStateBreak 装不上去。

修复

EmmyFacade::Hook 进入 lua 处理路径时,若当前没有 hit 的 debugger,就把正在跑 hook 的这个 debugger 登记为 hitDebugger。这样首次 pause 也能定位到目标 vm。仅修改 emmy_facade.cpp,新增 7 行。

…ction routes pause through hitDebugger, which stays null until a breakpoint actually fires.
@CppCXY CppCXY merged commit 5e9b4ea into EmmyLua:master Apr 29, 2026
1 check 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.

2 participants