MCPcopy Create free account
hub / github.com/MergHQ/CRYENGINE / DumpCallStack

Function DumpCallStack

Code/CryEngine/CryScriptSystem/ScriptSystem.cpp:195–216  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

193
194 //////////////////////////////////////////////////////////////////////////
195 void DumpCallStack(lua_State* L)
196 {
197 lua_Debug ar;
198
199 memset(&ar, 0, sizeof(lua_Debug));
200
201 //////////////////////////////////////////////////////////////////////////
202 // Print callstack.
203 //////////////////////////////////////////////////////////////////////////
204 int level = 0;
205 while (lua_getstack(L, level++, &ar))
206 {
207 const char* slevel = "";
208 if (level == 1)
209 slevel = " ";
210 int nRes = lua_getinfo(L, "lnS", &ar);
211 if (ar.name)
212 CryLog("$6%s > %s, (%s: %d)", slevel, ar.name, ar.short_src, ar.currentline);
213 else
214 CryLog("$6%s > (null) (%s: %d)", slevel, ar.short_src, ar.currentline);
215 }
216 }
217
218 void* custom_lua_alloc(void* ud, void* ptr, size_t osize, size_t nsize)
219 {

Callers 3

custom_lua_allocFunction · 0.85
cutsom_lua_panicFunction · 0.85
LogStackTraceMethod · 0.85

Calls 1

CryLogFunction · 0.85

Tested by

no test coverage detected