mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
support empty line
This commit is contained in:
@@ -65,25 +65,27 @@ local function hook_dispatch(dispatcher, resp, fd, channel)
|
|||||||
if cmd == "cont" then
|
if cmd == "cont" then
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
if sleep then
|
if cmd ~= "" then
|
||||||
if cmd == "c" then
|
if sleep then
|
||||||
print "continue..."
|
if cmd == "c" then
|
||||||
prompt = string.format(":%08x>", address)
|
print "continue..."
|
||||||
newline = true
|
prompt = string.format(":%08x>", address)
|
||||||
return
|
newline = true
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
local f = load("return "..cmd, "=(debug)", "t", env)
|
local f = load("return "..cmd, "=(debug)", "t", env)
|
||||||
if not f then
|
|
||||||
local err
|
|
||||||
f,err = load(cmd, "=(debug)", "t", env)
|
|
||||||
if not f then
|
if not f then
|
||||||
socket.write(fd, err .. "\n")
|
local err
|
||||||
|
f,err = load(cmd, "=(debug)", "t", env)
|
||||||
|
if not f then
|
||||||
|
socket.write(fd, err .. "\n")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if f then
|
||||||
|
print(select(2,pcall(f)))
|
||||||
end
|
end
|
||||||
end
|
|
||||||
if f then
|
|
||||||
print(select(2,pcall(f)))
|
|
||||||
end
|
end
|
||||||
newline = true
|
newline = true
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -228,9 +228,7 @@ function COMMAND.debug(address, fd)
|
|||||||
skynet.send(agent, "lua", "cmd", "cont")
|
skynet.send(agent, "lua", "cmd", "cont")
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
if cmdline ~= "" then
|
skynet.send(agent, "lua", "cmd", cmdline)
|
||||||
skynet.send(agent, "lua", "cmd", cmdline)
|
|
||||||
end
|
|
||||||
until stop or cmdline == "cont"
|
until stop or cmdline == "cont"
|
||||||
end)
|
end)
|
||||||
skynet.call(agent, "lua", "start", address, fd)
|
skynet.call(agent, "lua", "start", address, fd)
|
||||||
|
|||||||
Reference in New Issue
Block a user