Skip to content

Commit

Permalink
support empty line
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwu committed Feb 9, 2015
1 parent 498f634 commit e031a35
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
32 changes: 17 additions & 15 deletions lualib/skynet/remotedebug.lua
Expand Up @@ -65,25 +65,27 @@ local function hook_dispatch(dispatcher, resp, fd, channel)
if cmd == "cont" then
break
end
if sleep then
if cmd == "c" then
print "continue..."
prompt = string.format(":%08x>", address)
newline = true
return
if cmd ~= "" then
if sleep then
if cmd == "c" then
print "continue..."
prompt = string.format(":%08x>", address)
newline = true
return
end
end
end

local f = load("return "..cmd, "=(debug)", "t", env)
if not f then
local err
f,err = load(cmd, "=(debug)", "t", env)
local f = load("return "..cmd, "=(debug)", "t", env)
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
if f then
print(select(2,pcall(f)))
end
newline = true
else
Expand Down
4 changes: 1 addition & 3 deletions service/debug_console.lua
Expand Up @@ -228,9 +228,7 @@ function COMMAND.debug(address, fd)
skynet.send(agent, "lua", "cmd", "cont")
break
end
if cmdline ~= "" then
skynet.send(agent, "lua", "cmd", cmdline)
end
skynet.send(agent, "lua", "cmd", cmdline)
until stop or cmdline == "cont"
end)
skynet.call(agent, "lua", "start", address, fd)
Expand Down

0 comments on commit e031a35

Please sign in to comment.