lua-users home
lua-l archive

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

>Can anyone point me to an example of how to get a stack traceback using an
>error handler and lua_pcall?

The standard traceback you get in the standalone interpreter when an
error happens is output using this scheme (of course!). See lcall in
lua.c in Lua 5.0 (beta). It runs code by setting the value of the
global variable _TRACEBACK as an error handler. The debug library sets
_TRACEBACK (see errorfb in ldblib.c).