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

Function varinfo

third-party/lua-5.4.6/src/ldebug.c:732–745  ·  view source on GitHub ↗

** Build a string with a "description" for the value 'o', such as ** "variable 'x'" or "upvalue 'y'". */

Source from the content-addressed store, hash-verified

730** "variable 'x'" or "upvalue 'y'".
731*/
732static const char *varinfo (lua_State *L, const TValue *o) {
733 CallInfo *ci = L->ci;
734 const char *name = NULL; /* to avoid warnings */
735 const char *kind = NULL;
736 if (isLua(ci)) {
737 kind = getupvalname(ci, o, &name); /* check whether 'o' is an upvalue */
738 if (!kind) { /* not an upvalue? */
739 int reg = instack(ci, o); /* try a register */
740 if (reg >= 0) /* is 'o' a register? */
741 kind = getobjname(ci_func(ci)->p, currentpc(ci), reg, &name);
742 }
743 }
744 return formatvarinfo(L, kind, name);
745}
746
747
748/*

Callers 3

luaG_typeerrorFunction · 0.70
luaG_callerrorFunction · 0.70
luaG_tointerrorFunction · 0.70

Calls 5

getupvalnameFunction · 0.70
instackFunction · 0.70
getobjnameFunction · 0.70
currentpcFunction · 0.70
formatvarinfoFunction · 0.70

Tested by

no test coverage detected