You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My use case now is work with server which creates separate coroutine for each request.
So code looks like this
mobdebug.coro()
mobdebug.start()
mobdebug.off()
functionhandler() -- this function calls in coromobdebug.on()
....
mobdebug.off()
end
In this case I have small inconvenience.
Debugger interrupt execution of main thread just after mobdebug.start() returns.
But I really do not need this. I just need only connect to debugger and then
just turn on debugger in some functions.
So I suggest add one more argument to start
In my system i implement it just like if off then mobdebug.off() end before return true
inside start function and use it like
mobdebug.coro()
mobdebug.start(nil, nil, true)
functionhandler()
mobdebug.on()
....
mobdebug.off()
end
The text was updated successfully, but these errors were encountered:
Any updates on this (or any other way to do this)? Specifically on skipping the first debugger pause from start()? My use case is debugging in openresty and using a mobdebug listener from my shell. I would rather only break at my pause statements.
@moteus, coming back to this, three years later. I'd prefer to provide a table with options instead of adding a third parameter. Here is a patch against a current master; it adds runonstart option you can set to false to disable stopping:
diff --git a/src/mobdebug.lua b/src/mobdebug.lua
index dc4ea68..364c696 100644
--- a/src/mobdebug.lua+++ b/src/mobdebug.lua@@ -1056,8 +1056,11 @@ local function start(controller_host, controller_port)
-- only one debugging session can be run (as there is only one debug hook)
if isrunning() then return end
- lasthost = controller_host or lasthost- lastport = controller_port or lastport+ local opt = (type(controller_host) == "table" and controller_host+ or {hostname = controller_host, port = controller_port})++ lasthost = opt.hostname or lasthost+ lastport = opt.port or lastport
controller_host = lasthost or "localhost"
controller_port = lastport or mobdebug.port
@@ -1101,7 +1104,7 @@ local function start(controller_host, controller_port)
coro_debugger = corocreate(debugger_loop)
debug.sethook(debug_hook, HOOKMASK)
seen_hook = nil -- reset in case the last start() call was refused
- step_into = true -- start with step command+ if opt.runonstart ~= false then step_into = true end -- start with step command
return true
else
print(("Could not connect to %s:%s: %s")
My use case now is work with server which creates separate coroutine for each request.
So code looks like this
In this case I have small inconvenience.
Debugger interrupt execution of main thread just after
mobdebug.start()
returns.But I really do not need this. I just need only connect to debugger and then
just turn on debugger in some functions.
So I suggest add one more argument to
start
In my system i implement it just like
if off then mobdebug.off() end
beforereturn true
inside
start
function and use it likeThe text was updated successfully, but these errors were encountered: