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

Function funcnamefromcall

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

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

Callers 2

getfuncnameFunction · 0.70
luaG_callerrorFunction · 0.70

Calls 2

funcnamefromcodeFunction · 0.70
currentpcFunction · 0.70

Tested by

no test coverage detected