MCPcopy Create free account
hub / github.com/Tencent/sluaunreal / luaL_traceback

Function luaL_traceback

Plugins/slua_unreal/External/lua/lauxlib.cpp:136–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134
135
136LUALIB_API void luaL_traceback (lua_State *L, lua_State *L1,
137 const char *msg, int level) {
138 lua_Debug ar;
139 int top = lua_gettop(L);
140 int last = lastlevel(L1);
141 int n1 = (last - level > LEVELS1 + LEVELS2) ? LEVELS1 : -1;
142 if (msg)
143 lua_pushfstring(L, "%s\n", msg);
144 luaL_checkstack(L, 10, NULL);
145 lua_pushliteral(L, "stack traceback:");
146 while (lua_getstack(L1, level++, &ar)) {
147 if (n1-- == 0) { /* too many levels? */
148 lua_pushliteral(L, "\n\t..."); /* add a '...' */
149 level = last - LEVELS2 + 1; /* and skip to last ones */
150 }
151 else {
152 lua_getinfo(L1, "Slnt", &ar);
153 lua_pushfstring(L, "\n\t%s:", ar.short_src);
154 if (ar.currentline > 0)
155 lua_pushfstring(L, "%d:", ar.currentline);
156 lua_pushliteral(L, " in ");
157 pushfuncname(L, &ar);
158 if (ar.istailcall)
159 lua_pushliteral(L, "\n\t(...tail calls...)");
160 lua_concat(L, lua_gettop(L) - top);
161 }
162 }
163 lua_concat(L, lua_gettop(L) - top);
164}
165
166/* }====================================================== */
167

Callers 3

db_tracebackFunction · 0.85
errorFunction · 0.85
addRefTracebackMethod · 0.85

Calls 8

lua_gettopFunction · 0.85
lastlevelFunction · 0.85
lua_pushfstringFunction · 0.85
luaL_checkstackFunction · 0.85
lua_getstackFunction · 0.85
lua_getinfoFunction · 0.85
pushfuncnameFunction · 0.85
lua_concatFunction · 0.85

Tested by

no test coverage detected