lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On 12/09/2014 07:29 AM, Dong Feng wrote:

2014-12-08 20:18 GMT-08:00 Thomas Jericke <>:

My dubugger works like this. The hook yields from any line, when you resume the program it may call lua_resume on a lua_state standing at any possible instruction.

I also have the metamethod case, as I have some callable objects which yield on call.

So that suggests your debugger runs a debugged program as a coroutine, and invokes yield in the debug hooks. And it calls lua_resume to continue running the debugged program after completing the debug affairs. Do I understand correctly?

Is this your debugger's specific implementation, or is this the recommended way of Lua to implement a debugger (or only way, or most orthodox way)?

Thank you,

As I understand it, the recommended way is to debug inside of the hook function and not to yield. But I wasn't satisfied with that solution as this means all coroutines stop if one coroutine is on a breakpoint.