diff --git a/library/LuaTools.cpp b/library/LuaTools.cpp index 3154b5296..0ec0855ed 100644 --- a/library/LuaTools.cpp +++ b/library/LuaTools.cpp @@ -1757,7 +1757,7 @@ lua_State *DFHack::Lua::Open(color_ostream &out, lua_State *state) // reads config from .luacov or uses defaults if file doesn't exist. // note that luacov overrides the debug hook installed by // interrupt_init() above. - if (PushModulePublic(out, state, "luacov_helper", "init") && + if (PushModulePublic(out, state, "luacov.runner", "init") && SafeCall(out, state, 0, 0)) { out.print("Initialized luacov coverage monitoring\n"); diff --git a/library/lua/luacov_helper.lua b/library/lua/luacov_helper.lua index d2e24fffb..287faffe9 100644 --- a/library/lua/luacov_helper.lua +++ b/library/lua/luacov_helper.lua @@ -3,28 +3,13 @@ local runner = require('luacov.runner') -print('runner.debug_hook:', runner.debug_hook) - -function init() - runner.init() - print('** initializing luacov') - print('** set debug hook to:', debug.gethook()) -end - -- Called by LuaTools.cpp to set the debug hook for new threads. We could do -- this in C++, but that's complicated and scary. function with_luacov(f) - print('** wrapping function', f) return function(...) - print('** setting debug hook') - print('** was:', debug.gethook()) debug.sethook(runner.debug_hook, "l") - print('** is now:', debug.gethook()) - print('** running function:', f) - print('** params:', ...) return f(...) end end - return _ENV