MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / lua_getinfo

Function lua_getinfo

extlibs/lua/src/ldebug.c:388–416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

386
387
388LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) {
389 int status;
390 Closure *cl;
391 CallInfo *ci;
392 TValue *func;
393 lua_lock(L);
394 if (*what == '>') {
395 ci = NULL;
396 func = s2v(L->top - 1);
397 api_check(L, ttisfunction(func), "function expected");
398 what++; /* skip the '>' */
399 L->top--; /* pop function */
400 }
401 else {
402 ci = ar->i_ci;
403 func = s2v(ci->func);
404 lua_assert(ttisfunction(func));
405 }
406 cl = ttisclosure(func) ? clvalue(func) : NULL;
407 status = auxgetinfo(L, what, ar, cl, ci);
408 if (strchr(what, 'f')) {
409 setobj2s(L, L->top, func);
410 api_incr_top(L);
411 }
412 if (strchr(what, 'L'))
413 collectvalidlines(L, cl);
414 lua_unlock(L);
415 return status;
416}
417
418
419/*

Callers 9

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

Calls 2

auxgetinfoFunction · 0.85
collectvalidlinesFunction · 0.85

Tested by

no test coverage detected