diff options
author | Eugene Sandulenko | 2019-06-20 12:38:32 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:16:51 +0200 |
commit | 641c2a91796a4fbfecc80652b3dbfb0a597f02eb (patch) | |
tree | bf543959fc58c829f3a840e8ec32b2e95e8d39eb /engines | |
parent | 8810def2b257601d61013bb255d87521910c47e5 (diff) | |
download | scummvm-rg350-641c2a91796a4fbfecc80652b3dbfb0a597f02eb.tar.gz scummvm-rg350-641c2a91796a4fbfecc80652b3dbfb0a597f02eb.tar.bz2 scummvm-rg350-641c2a91796a4fbfecc80652b3dbfb0a597f02eb.zip |
HDB: Added Lua print stack utility function
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hdb/lua-script.cpp | 7 | ||||
-rw-r--r-- | engines/hdb/lua-script.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/engines/hdb/lua-script.cpp b/engines/hdb/lua-script.cpp index 5259c10932..08d5f77fa6 100644 --- a/engines/hdb/lua-script.cpp +++ b/engines/hdb/lua-script.cpp @@ -960,6 +960,13 @@ void LuaScript::checkParameters(const char *func, int params) { } } +void lua_printstack(lua_State *L) { + int n = lua_gettop(L); + for (int i = 1; i <= n; i++) { + debug(1, "STACK %d %s %s", i, lua_tostring(L, i), luaL_typename(L, i)); + } +} + const char *LuaScript::getStringOffStack() { if (!_systemInit) { return NULL; diff --git a/engines/hdb/lua-script.h b/engines/hdb/lua-script.h index 20cd94d331..32830b3c11 100644 --- a/engines/hdb/lua-script.h +++ b/engines/hdb/lua-script.h @@ -60,6 +60,8 @@ private: void addPatches(Common::String &chunk, const char *scriptName); }; +void lua_printstack(lua_State *L); + } #endif // !HDB_LUA_SCRIPT_H |