lua-users home
lua-l archive

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



Am 10.12.2012 um 12:41 schrieb Luiz Henrique de Figueiredo:

can I create a dump of the Lua stack on C ?

See http://lua-users.org/lists/lua-l/2009-01/msg00147.html and its thread.


Thanks for the link, I have change the code a little bit to C++.
I iterate over my stack and check the stack element with lua_type, but
I have got on the function type a problem

 case LUA_TFUNCTION      : p_stream << (lua_iscfunction(p_lua.m_lua.get(), i) ? "c" : "lua") << " function : "
                                          lua_Debug l_debug;
                                          lua_getinfo(p_lua.m_lua.get(), ">n", &l_debug);
                                          p_stream << l_debug.name << " (" << l_debug.namewhat << ")";
                                          break;

I would like to read the function name on the stack element i. How can I read the name?
Thanks

Phil