lua-users home
lua-l archive

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


We've got a lua_atpanic() handler in our application which just dumps a
stack trace using the simple Lua debug interface functions.  That works
fine, except whenever a coroutine does something stupid.  

Errant coroutines, of course, cause coroutine.resume() to return (false,
message), and the message is fairly informative, but a stack trace would be
much more helpful.  If we error() out at that point, we just get a stack
trace leading up to the coroutine.resume() -- the rest of the stack is
unwound by that point, naturally.

Is there any simple way to "panic" or at least get a stack trace after a
coroutine breaks but before the stack unwinds?

-Andy