bugfix isse #592

This commit is contained in:
Cloud Wu
2017-03-20 16:25:15 +08:00
parent 80d9ec379f
commit 67b055009d
2 changed files with 30 additions and 6 deletions

View File

@@ -10,9 +10,13 @@ function CMD.start(address, fd)
skynet.error(string.format("Attach to :%08x", address))
local handle
channel, handle = debugchannel.create()
skynet.call(address, "debug", "REMOTEDEBUG", fd, handle)
-- todo hook
skynet.ret(skynet.pack(nil))
local ok, err = pcall(skynet.call, address, "debug", "REMOTEDEBUG", fd, handle)
if not ok then
skynet.ret(skynet.pack(false, "Debugger attach failed"))
else
-- todo hook
skynet.ret(skynet.pack(true))
end
skynet.exit()
end
@@ -20,6 +24,10 @@ function CMD.cmd(cmdline)
channel:write(cmdline)
end
function CMD.ping()
skynet.ret()
end
skynet.start(function()
skynet.dispatch("lua", function(_,_,cmd,...)
local f = CMD[cmd]