unknownworlds / decoda

Decoda Lua IDE and debugger
GNU General Public License v3.0
900 stars 264 forks source link

Step by step debugging fails after pcall #24

Open ignacio opened 10 years ago

ignacio commented 10 years ago

Given the following snippet:

local string = require "string"

pcall(error, "some error")

print("hello world")
print("bar")

If I set a breakpoint on line 1, and then go step by step with F10 (Step Over), it works until I try to step over the line with pcall. At that point it just runs until the end.

However, if I step with F11 (Step Into), I can step on each line with no problem.

Tested this with Decoda 1.16 and 1.17 (build 1035 beta 1), it behaves the same in both.

benoit-germain commented 10 years ago

Notice that this is true only if an error is raised inside pcall.

yangxiaopo commented 5 years ago

My condition: In void DebugFrontend::EventThreadProc(); In eventId == EventId_Break After pcall stackFrame is set ok, however, the next stackFrame get a look wrong value from m_pipe. End

if (m_stackFrames[i].scriptIndex != -1) { //TODO //assert(m_stackFrames[i].scriptIndex < m_scripts.size()); if (m_stackFrames[i].scriptIndex >= m_scripts.size()) { m_stackFrames[i].scriptIndex = -1; } } works temporarily ;)