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

Function varinfo

third-party/lua-5.5.0/src/ldebug.c:727–740  ·  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

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

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