Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions extension/script/backend/bootstrap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ local function initMaster(rootpath, address)
ExitGuard = setmetatable({}, {__gc=function()
chan:push(nil, "EXIT")
thread.wait(mt)
channel.destroy("DbgMaster")
end})
end

Expand Down
1 change: 1 addition & 0 deletions extension/script/backend/worker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,7 @@ end

function event.exit()
sendToMaster 'exitWorker' {}
channel.destroy(WorkerChannel)
end

hookmgr.init(function(name, ...)
Expand Down
6 changes: 5 additions & 1 deletion extension/script/debugger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ function dbg:start(cfg)
end

function dbg:attach(cfg)
initDebugger(self, cfg)
initDebugger(self, cfg or {})

self.rdebug.start(([[
local rootpath = %q
Expand All @@ -199,6 +199,10 @@ function dbg:attach(cfg)
return self
end

function dbg:stop()
self.rdebug.clear()
end

function dbg:event(...)
self.rdebug.event(...)
return self
Expand Down
6 changes: 6 additions & 0 deletions src/luadebug/rdebug_hookmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,10 @@ struct hookmgr {
}
luadebug::eventfree::destroy(hL, eventfree);
lua_sethook(hL, 0, 0, 0);
#if defined(LUADEBUG_DISABLE_THUNK)
// clear hook manager pointer stored in thunk:
thunk_set(hL, &THUNK_MGR, intptr_t(nullptr));
#endif
#if defined(LUA_HOOKEXCEPTION)
exception_open(hL, 0);
#endif
Expand All @@ -594,11 +598,13 @@ struct hookmgr {
#else
static int full_hook_callback(lua_State* hL, lua_Debug* ar) {
hookmgr* mgr = (hookmgr*)thunk_get(hL, &THUNK_MGR);
if (!mgr) return 0;
mgr->full_hook(hL, ar);
return 0;
}
static int idle_hook_callback(lua_State* hL, lua_Debug* ar) {
hookmgr* mgr = (hookmgr*)thunk_get(hL, &THUNK_MGR);
if (!mgr) return 0;
mgr->idle_hook(hL, ar);
return 0;
}
Expand Down
Loading