lua-users home
lua-l archive

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

Hi All,

I'd like to move this debug.traceback discussion from LuaJIT maillist
here [1]. debug.traceback used to be the only mechanism to catch
run-time errors for code chunks you didn't load yourself and it
appears that this mechanism is not available in Lua 5.2+ or LuaJIT as
debug.traceback is not called anymore in those cases.

As such we are left without any alternative for catching run-time
errors from the Lua layer. Mike mentioned using a new hook as a
possible solution. Could this be considered as it would definitely
solve the issue of catching the errors?

While we are at it, it would also be nice to track yield/resume calls
as this would also allow to track coroutine switches, which is not
currently available from the Lua side either (it's possible to
overwrite coroutine.create/yield/resume calls, but those can be cached
locally or called from the C API side, which bypasses overwrites).