diff options
Diffstat (limited to 'src/libluaglue/LuaVM.cpp')
-rw-r--r-- | src/libluaglue/LuaVM.cpp | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/libluaglue/LuaVM.cpp b/src/libluaglue/LuaVM.cpp index fb40c85..e75a1c9 100644 --- a/src/libluaglue/LuaVM.cpp +++ b/src/libluaglue/LuaVM.cpp @@ -149,13 +149,34 @@ void LuaVM::dumpStackElement( lua_State *l, int i, int indent ) lua_CFunction f = lua_tocfunction( l, i ); char buf[33]; snprintf( buf, 32, "function[%016" PRIxPTR "]", (uintptr_t)f ); + // TODO: int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar); cout << "LUA_TFUNCTION " << buf; break; } -//#define LUA_TLIGHTUSERDATA 2 -//#define LUA_TUSERDATA 7 -//#define LUA_TTHREAD 8 + case LUA_TLIGHTUSERDATA: { + void *p = lua_touserdata( l, i ); + char buf[33]; + snprintf( buf, 32, "void *[%016" PRIxPTR "]", (uintptr_t)p ); + cout << "LUA_TLIGHTUSERDATA " << buf; + break; + } + + case LUA_TUSERDATA: { + void *p = lua_touserdata( l, i ); + char buf[33]; + snprintf( buf, 32, "void *[%016" PRIxPTR "]", (uintptr_t)p ); + // TODO: is there a tostring entry in the metatable? + cout << "LUA_TUSERDATA " << buf; + break; + } + + case LUA_TTHREAD: { + //lua_State *thread = lua_tothread( l, i ); + // TODO: more information like status of the thread? + cout << "LUA_TTHREAD "; + break; + } default: cout << lua_typename( l, type ) << " <unknown>"; |