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

Method Attach

emmy_debugger/src/emmy_facade.cpp:390–402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

388}
389
390void EmmyFacade::Attach(lua_State *L) {
391 if (!this->transporter->IsConnected())
392 return;
393
394 // 这里存在一个问题就是 hook 的时机太早了,globalstate 都还没初始化完毕
395
396 if (!isAPIReady) {
397 // 考虑到emmy_hook use lua source
398 isAPIReady = install_emmy_debugger(L);
399 }
400
401 lua_sethook(L, EmmyFacade::HookLua, LUA_MASKCALL | LUA_MASKLINE | LUA_MASKRET, 0);
402}
403
404bool EmmyFacade::RegisterTypeName(lua_State *L, const std::string &typeName, std::string &err) {
405 auto debugger = GetDebugger(L);

Callers 8

ReadyLuaHookMethod · 0.45
HookMethod · 0.45
lua_pcall_workerFunction · 0.45
lua_pcallk_workerFunction · 0.45
lua_error_workerFunction · 0.45
lua_resume_worker_54Function · 0.45
lua_resume_worker_53_52Function · 0.45
lua_resume_worker_51Function · 0.45

Calls 3

install_emmy_debuggerFunction · 0.85
IsConnectedMethod · 0.80
lua_sethookFunction · 0.50

Tested by

no test coverage detected