Bazaar developer reference

LuaSupport::DumpCallStack(lua_State *)

Defined in
Lua/CvLuaSupport.cpp, line 53
Hook name
CivHooks::LuaSupport_DumpCallStack

Hooks

static bool BeforeLuaSupport_DumpCallStack(lua_State* L);static void AfterLuaSupport_DumpCallStack(lua_State* L);static void ReplaceLuaSupport_DumpCallStack(void (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::LuaSupport_DumpCallStack>(host, &BeforeLuaSupport_DumpCallStack);CivRegisterAfter<CivHooks::LuaSupport_DumpCallStack>(host, &AfterLuaSupport_DumpCallStack);CivRegisterReplace<CivHooks::LuaSupport_DumpCallStack>(host, &ReplaceLuaSupport_DumpCallStack);

Code

53void LuaSupport::DumpCallStack(lua_State* L)54{55	for(int i = 1; i < 10; ++i)56	{57		lua_Debug ar;58		if(lua_getstack(L, i, &ar))59		{60			lua_getinfo(L, "Sl", &ar);61			if(ar.currentline > 0)62			{63				FStringFixedBuffer(szTemp, 512);64				szTemp.Format("%s:%d\n", (ar.source)?ar.source:"", ar.currentline);65				OutputDebugString(szTemp.c_str());66			}67		}68	}69}

Calls