MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / lua_getinfo

Function lua_getinfo

3rd/lua-5.4.3/src/ldebug.c:382–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 6

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

Calls 2

auxgetinfoFunction · 0.85
collectvalidlinesFunction · 0.85

Tested by

no test coverage detected