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

Method ReadyLuaHook

emmy_debugger/src/emmy_facade.cpp:39–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39void EmmyFacade::ReadyLuaHook(lua_State *L, lua_Debug *ar) {
40 if (!Get().readyHook) {
41 return;
42 }
43 Get().readyHook = false;
44
45 auto states = FindAllCoroutine(L);
46
47 for (auto state: states) {
48 lua_sethook(state, HookLua, LUA_MASKCALL | LUA_MASKLINE | LUA_MASKRET, 0);
49 }
50
51 lua_sethook(L, HookLua, LUA_MASKCALL | LUA_MASKLINE | LUA_MASKRET, 0);
52
53 auto debugger = Get().GetDebugger(L);
54 if (debugger) {
55 debugger->Attach();
56 }
57
58 Get().Hook(L, ar);
59}
60
61EmmyFacade::EmmyFacade()
62 : transporter(nullptr),

Callers

nothing calls this directly

Calls 5

FindAllCoroutineFunction · 0.85
lua_sethookFunction · 0.50
GetDebuggerMethod · 0.45
AttachMethod · 0.45
HookMethod · 0.45

Tested by

no test coverage detected