MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / lua_getinfo

Function lua_getinfo

lib/lua/src/ldebug.c:385–413  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 7

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