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

Function luaG_tracecall

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

** Traces Lua calls. If code is running the first instruction of a function, ** and function is not vararg, and it is not coming from an yield, ** calls 'luaD_hookcall'. (Vararg functions will call 'luaD_hookcall' ** after adjusting its variable arguments; otherwise, they could call ** a line/count hook before the call hook. Functions coming from ** an yield already called 'luaD_hookcall' before y

Source from the content-addressed store, hash-verified

900** an yield already called 'luaD_hookcall' before yielding.)
901*/
902int luaG_tracecall (lua_State *L) {
903 CallInfo *ci = L->ci;
904 Proto *p = ci_func(ci)->p;
905 ci->u.l.trap = 1; /* ensure hooks will be checked */
906 if (ci->u.l.savedpc == p->code) { /* first instruction (not resuming)? */
907 if (p->is_vararg)
908 return 0; /* hooks will start at VARARGPREP instruction */
909 else if (!(ci->callstatus & CIST_HOOKYIELD)) /* not yieded? */
910 luaD_hookcall(L, ci); /* check 'call' hook */
911 }
912 return 1; /* keep 'trap' on */
913}
914
915
916/*

Callers 1

luaV_executeFunction · 0.70

Calls 1

luaD_hookcallFunction · 0.70

Tested by

no test coverage detected