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

Function lua_getinfo

third-party/lua-5.3.5/src/ldebug.c:309–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

307
308
309LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) {
310 int status;
311 Closure *cl;
312 CallInfo *ci;
313 StkId func;
314 lua_lock(L);
315 swapextra(L);
316 if (*what == '>') {
317 ci = NULL;
318 func = L->top - 1;
319 api_check(L, ttisfunction(func), "function expected");
320 what++; /* skip the '>' */
321 L->top--; /* pop function */
322 }
323 else {
324 ci = ar->i_ci;
325 func = ci->func;
326 lua_assert(ttisfunction(ci->func));
327 }
328 cl = ttisclosure(func) ? clvalue(func) : NULL;
329 status = auxgetinfo(L, what, ar, cl, ci);
330 if (strchr(what, 'f')) {
331 setobjs2s(L, L->top, func);
332 api_incr_top(L);
333 }
334 swapextra(L); /* correct before option 'L', which can raise a mem. error */
335 if (strchr(what, 'L'))
336 collectvalidlines(L, cl);
337 lua_unlock(L);
338 return status;
339}
340
341
342/*

Callers 7

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

Calls 3

swapextraFunction · 0.70
auxgetinfoFunction · 0.70
collectvalidlinesFunction · 0.70

Tested by

no test coverage detected