lua-users home
lua-l archive

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


Dear list,

Suppose I have some function to walk up the C-stack to print the C-backtrace.

Now my goal is to intermix this C-backtrace with the corresponding Lua-backtrace.
This means I have to identify a known function from the Lua interpreter. Somehow 
find the L pointer and then use the regular lua_* functions to query the stack.

I think luaV_execute is the function to look for in the C-stack. 
Then look in the c-stack of this stack frame to find something that looks like a lua_State*.
Some basic verfications of the lua_State invariants should be necessary.
Then call lua_getstack & co.

Has anyone done this before? Is this hopeless? 
Or are there any other methods to achieve my goal?


   Jörg