MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / lua_getinfo

Function lua_getinfo

third-party/lua-5.2.4/src/ldebug.c:281–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

279
280
281LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) {
282 int status;
283 Closure *cl;
284 CallInfo *ci;
285 StkId func;
286 lua_lock(L);
287 swapextra(L);
288 if (*what == '>') {
289 ci = NULL;
290 func = L->top - 1;
291 api_check(L, ttisfunction(func), "function expected");
292 what++; /* skip the '>' */
293 L->top--; /* pop function */
294 }
295 else {
296 ci = ar->i_ci;
297 func = ci->func;
298 lua_assert(ttisfunction(ci->func));
299 }
300 cl = ttisclosure(func) ? clvalue(func) : NULL;
301 status = auxgetinfo(L, what, ar, cl, ci);
302 if (strchr(what, 'f')) {
303 setobjs2s(L, L->top, func);
304 api_incr_top(L);
305 }
306 swapextra(L);
307 if (strchr(what, 'L'))
308 collectvalidlines(L, cl);
309 lua_unlock(L);
310 return status;
311}
312
313
314/*

Callers 8

pushglobalfuncnameFunction · 0.70
luaL_tracebackFunction · 0.70
luaL_argerrorFunction · 0.70
luaL_whereFunction · 0.70
set_envFunction · 0.70
db_getinfoFunction · 0.70
checkupvalFunction · 0.70
hookfFunction · 0.70

Calls 3

swapextraFunction · 0.70
auxgetinfoFunction · 0.70
collectvalidlinesFunction · 0.70

Tested by

no test coverage detected