Skip to content

Commit

Permalink
debug_console add dbgcmd command (cloudwu#1325)
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudfreexiao authored Jan 18, 2021
1 parent cfb6382 commit 4c9c9ce
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions service/debug_console.lua
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ function COMMAND.help()
profactive = "profactive [on|off] : active/deactive jemalloc heap profilling",
dumpheap = "dumpheap : dump heap profilling",
killtask = "killtask address threadname : threadname listed by task",
dbgcmd = "run address debug command",
}
end

Expand Down Expand Up @@ -273,24 +274,25 @@ function COMMAND.inject(address, filename, ...)
return output
end

function COMMAND.task(address)
function COMMAND.dbgcmd(address, cmd, ...)
address = adjust_address(address)
return skynet.call(address,"debug","TASK")
return skynet.call(address, "debug", cmd, ...)
end

function COMMAND.task(address)
return COMMAND.dbgcmd(address, "TASK")
end

function COMMAND.killtask(address, threadname)
address = adjust_address(address)
return skynet.call(address, "debug", "KILLTASK", threadname)
return COMMAND.dbgcmd(address, "KILLTASK", threadname)
end

function COMMAND.uniqtask(address)
address = adjust_address(address)
return skynet.call(address,"debug","UNIQTASK")
return COMMAND.dbgcmd(address, "UNIQTASK")
end

function COMMAND.info(address, ...)
address = adjust_address(address)
return skynet.call(address,"debug","INFO", ...)
return COMMAND.dbgcmd(address, "INFO", ...)
end

function COMMANDX.debug(cmd)
Expand Down

0 comments on commit 4c9c9ce

Please sign in to comment.