MCPcopy Create free account
hub / github.com/DFHack/dfhack / lua_getinfo

Function lua_getinfo

depends/lua/src/ldebug.c:310–340  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 7

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

Calls 3

swapextraFunction · 0.85
auxgetinfoFunction · 0.85
collectvalidlinesFunction · 0.85

Tested by

no test coverage detected