lua_getfield(L, LUA_GLOBALSINDEX, "debug.traceback" ); Is it equivalent to the following code? lua_getfield(L, LUA_GLOBALSINDEX, "debug"); if (lua_istable(L, -1)) { lua_getfield(L, -1, "traceback"); lua_remove(L, -2); }