[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Adding debug hook for error/yield/resume
- From: Paul K <paulclinger@...>
- Date: Mon, 17 Mar 2014 12:25:59 -0700
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).
Paul.
[1] http://www.freelists.org/post/luajit/Overriding-debugtraceback,9