pkulchenko / ZeroBraneStudio

Lightweight Lua-based IDE for Lua with code completion, syntax highlighting, live coding, remote debugger, and code analyzer; supports Lua 5.1, 5.2, 5.3, 5.4, LuaJIT and other Lua interpreters on Windows, macOS, and Linux
http://studio.zerobrane.com/
Other
2.61k stars 519 forks source link

zerobrane remote debug error #1051

Closed huhu-sky closed 4 years ago

huhu-sky commented 4 years ago
local mobdebug = require("mobdebug")
mobdebug.start("127.0.0.1")
local name = ngx.var.arg_name or "Anonymous"
ngx.say("helloba ", name, " !")
ngx.say("done debugging")
mobdebug.done()

while i start debugger server , and request nginx, it occured

Can't start debugging for 'C:\software\openresty-1.15.8.3-win32\lua\content.lua'. Compilation error:
Debugger connection closed
Debugging session completed (traced 0 instructions).
Debugger server stopped at wuhuhu:8172.
Debugger server started at wuhuhu:8172.
Can't start debugging for 'C:\software\openresty-1.15.8.3-win32\lua\content.lua'. Compilation error:
Debugger connection closed
Debugging session completed (traced 0 instructions).
Debugger server stopped at wuhuhu:8172.
Debugger server started at wuhuhu:8172.
Can't start debugging for 'C:\software\openresty-1.15.8.3-win32\lua\content.lua'. Compilation error:
Debugger connection closed
Debugging session completed (traced 0 instructions).
Can't start debugging for 'C:\software\openresty-1.15.8.3-win32\lua\content.lua'. Compilation error:
Debugger connection closed
Debugging session completed (traced 0 instructions).

i tried delete the last line

local mobdebug = require("mobdebug")
mobdebug.start("127.0.0.1")
local name = ngx.var.arg_name or "Anonymous"
ngx.say("helloba ", name, " !")
ngx.say("done debugging")
-- mobdebug.done()

try again, it cant stop on the breakpoint , and when i have multirequest, it occured:

Debugger server started at wuhuhu:8172.
Refused a request to start a new debugging session as there is one in progress already.
Refused a request to start a new debugging session as there is one in progress already.
Refused a request to start a new debugging session as there is one in progress already.
huhu-sky commented 4 years ago

openresty-1.15.8.3-win32 ZeroBrane Studio image

os: win10 64

pkulchenko commented 4 years ago

I don't see anything wrong with what you are doing. The only thing that comes to mind is to check your firewall settings or use 192.168.x.x address instead of 127.0.0.1, as it looks like the connection is established and then dropped immediately. You may also want to check if you have an anti-virus installed that may interfere with socket connections.

Refused a request to start a new debugging session as there is one in progress already.

Right, this is expected, as there is already one connection that hasn't been terminated yet (this is what .done() call does), so a new one can't be established.

huhu-sky commented 4 years ago

ok, Thanks to reply, i'll have a try;

pkulchenko commented 4 years ago

-- mobdebug.done() try again, it cant stop on the breakpoint , and when i have multirequest, it occured

Yes, you need to have mobdebug.done() call used in your script, otherwise you are going to run into this issue.

Also, stopping on the breakpoints should be fixed in 805a05a4, so you may want to re-test on the current master branch.