Overriding debug.traceback

  • From: Ignacio Burgueño <iburgueno@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Fri, 14 Mar 2014 16:48:20 -0300

Hi. I'm the author of StackTracePlus, a library to "enhance" stack traces
with additional information.
In my scripts, I usually just override debug.traceback with a custom
function. Works fine with Lua.

Then, I got this issue reported today, saying that the technique is not
working with LuaJIT:
https://github.com/ignacio/StackTracePlus/issues/6

Checking the source, I found out that the interpreter does not use the
function at debug.traceback, so whatever you put there won't be picked up.

What are the possibilities for the LuaJIT interpreter to behave like the
Lua one when generating stack traces? I mean, to pick up the function in
debug.traceback dynamically.

Regards,
Ignacio

Other related posts: