MCPcopy Create free account
hub / github.com/defold/defold / PrintStack

Function PrintStack

engine/script/src/script.cpp:1663–1682  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1661 };
1662
1663 void PrintStack(lua_State* L)
1664 {
1665 int top = lua_gettop(L);
1666 int bottom = 1;
1667 lua_getglobal(L, "tostring");
1668 for(int i = top; i >= bottom; i--)
1669 {
1670 lua_pushvalue(L, -1);
1671 lua_pushvalue(L, i);
1672 lua_pcall(L, 1, 1, 0);
1673 const char *str = lua_tostring(L, -1);
1674 if (str) {
1675 dmLogInfo("%2d: %s\n", i, str);
1676 }else{
1677 dmLogInfo("%2d: %s\n", i, luaL_typename(L, i));
1678 }
1679 lua_pop(L, 1);
1680 }
1681 lua_pop(L, 1);
1682 }
1683
1684 LuaCallbackInfo* CreateCallback(lua_State* L, int callback_stack_index)
1685 {

Callers

nothing calls this directly

Calls 3

lua_gettopFunction · 0.85
lua_pushvalueFunction · 0.85
lua_pcallFunction · 0.85

Tested by

no test coverage detected