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

Function funcnamefromcall

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

** Try to find a name for a function based on how it was called. */

Source from the content-addressed store, hash-verified

662** Try to find a name for a function based on how it was called.
663*/
664static const char *funcnamefromcall (lua_State *L, CallInfo *ci,
665 const char **name) {
666 if (ci->callstatus & CIST_HOOKED) { /* was it called inside a hook? */
667 *name = "?";
668 return "hook";
669 }
670 else if (ci->callstatus & CIST_FIN) { /* was it called as a finalizer? */
671 *name = "__gc";
672 return "metamethod"; /* report it as such */
673 }
674 else if (isLua(ci))
675 return funcnamefromcode(L, ci_func(ci)->p, currentpc(ci), name);
676 else
677 return NULL;
678}
679
680/* }====================================================== */
681

Callers 2

getfuncnameFunction · 0.70
luaG_callerrorFunction · 0.70

Calls 2

funcnamefromcodeFunction · 0.70
currentpcFunction · 0.70

Tested by

no test coverage detected