MCPcopy Create free account
hub / github.com/TASEmulators/fceux / CallLuaTraceback

Function CallLuaTraceback

src/lua-engine.cpp:2066–2083  ·  view source on GitHub ↗

Forces a stack trace and returns the string

Source from the content-addressed store, hash-verified

2064
2065// Forces a stack trace and returns the string
2066static const char *CallLuaTraceback(lua_State *L) {
2067 lua_getfield(L, LUA_GLOBALSINDEX, "debug");
2068 if (!lua_istable(L, -1)) {
2069 lua_pop(L, 1);
2070 return "";
2071 }
2072
2073 lua_getfield(L, -1, "traceback");
2074 if (!lua_isfunction(L, -1)) {
2075 lua_pop(L, 2);
2076 return "";
2077 }
2078
2079 lua_pushvalue(L, 1);
2080 lua_call(L, 1, 1);
2081
2082 return lua_tostring(L, -1);
2083}
2084
2085
2086void HandleCallbackError(lua_State* L)

Callers 2

HandleCallbackErrorFunction · 0.85
FCEU_LuaFrameBoundaryFunction · 0.85

Calls 3

lua_getfieldFunction · 0.85
lua_pushvalueFunction · 0.85
lua_callFunction · 0.85

Tested by

no test coverage detected