Skip to content

Commit bd43fc3

Browse files
committed
修改调试时单步跃入时bug
1 parent 37243b1 commit bd43fc3

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ elseif(${EMMY_LUA_VERSION} STREQUAL "jit")
6565
#add_definitions(-DEMMY_LUA_JIT_SUPPORT_LUA_SETFUNCS)
6666
endif()
6767

68-
add_definitions(-DEMMY_CORE_VERSION="1.0.16")
68+
add_definitions(-DEMMY_CORE_VERSION="1.2.7")
6969

7070
if(EMMY_USE_LUA_SOURCE)
7171
add_definitions(-DEMMY_USE_LUA_SOURCE)

emmy_debugger/src/hook_state.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,18 @@ bool HookStateStepIn::Start(std::shared_ptr<Debugger> debugger, lua_State* curre
9696
void HookStateStepIn::ProcessHook(std::shared_ptr<Debugger> debugger, lua_State* L, lua_Debug* ar)
9797
{
9898
UpdateStackLevel(debugger, L, ar);
99-
if (getDebugEvent(ar) == LUA_HOOKLINE && getDebugCurrentLine(ar) != line)
99+
if (getDebugEvent(ar) == LUA_HOOKLINE)
100100
{
101-
// todo : && file != ar->source
102-
debugger->HandleBreak();
101+
auto currentLine = getDebugCurrentLine(ar);
102+
auto source = getDebugSource(ar);
103+
if(currentLine != line || file != source)
104+
{
105+
debugger->HandleBreak();
106+
}
107+
return;
103108
}
104-
else StackLevelBasedState::ProcessHook(debugger, L, ar);
109+
110+
StackLevelBasedState::ProcessHook(debugger, L, ar);
105111
}
106112

107113
bool HookStateStepOut::Start(std::shared_ptr<Debugger> debugger, lua_State* current)

0 commit comments

Comments
 (0)