int luaQ_traceback(lua_State *L)

int luaQ_tracebackskip(lua_State *L, int skip)

Augments the string located on top of the stack with lines representing the stack trace of the Lua interpreter. This is convenient in error handlers. The skip topmost function calls are skipped.