| 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 | { |
nothing calls this directly
no test coverage detected