mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
fix #1154
This commit is contained in:
@@ -861,6 +861,7 @@ local debug = require "skynet.debug"
|
|||||||
debug.init(skynet, {
|
debug.init(skynet, {
|
||||||
dispatch = skynet.dispatch_message,
|
dispatch = skynet.dispatch_message,
|
||||||
suspend = suspend,
|
suspend = suspend,
|
||||||
|
resume = coroutine_resume,
|
||||||
})
|
})
|
||||||
|
|
||||||
return skynet
|
return skynet
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ local HOOK_FUNC = "raw_dispatch_message"
|
|||||||
local raw_dispatcher
|
local raw_dispatcher
|
||||||
local print = _G.print
|
local print = _G.print
|
||||||
local skynet_suspend
|
local skynet_suspend
|
||||||
|
local skynet_resume
|
||||||
local prompt
|
local prompt
|
||||||
local newline
|
local newline
|
||||||
|
|
||||||
@@ -169,20 +170,20 @@ local dbgcmd = {}
|
|||||||
function dbgcmd.s(co)
|
function dbgcmd.s(co)
|
||||||
local ctx = ctx_active[co]
|
local ctx = ctx_active[co]
|
||||||
ctx.next_mode = false
|
ctx.next_mode = false
|
||||||
skynet_suspend(co, coroutine.resume(co))
|
skynet_suspend(co, skynet_resume(co))
|
||||||
end
|
end
|
||||||
|
|
||||||
function dbgcmd.n(co)
|
function dbgcmd.n(co)
|
||||||
local ctx = ctx_active[co]
|
local ctx = ctx_active[co]
|
||||||
ctx.next_mode = true
|
ctx.next_mode = true
|
||||||
skynet_suspend(co, coroutine.resume(co))
|
skynet_suspend(co, skynet_resume(co))
|
||||||
end
|
end
|
||||||
|
|
||||||
function dbgcmd.c(co)
|
function dbgcmd.c(co)
|
||||||
sethook(co)
|
sethook(co)
|
||||||
ctx_active[co] = nil
|
ctx_active[co] = nil
|
||||||
change_prompt(string.format(":%08x>", skynet.self()))
|
change_prompt(string.format(":%08x>", skynet.self()))
|
||||||
skynet_suspend(co, coroutine.resume(co))
|
skynet_suspend(co, skynet_resume(co))
|
||||||
end
|
end
|
||||||
|
|
||||||
local function hook_dispatch(dispatcher, resp, fd, channel)
|
local function hook_dispatch(dispatcher, resp, fd, channel)
|
||||||
@@ -259,6 +260,7 @@ end
|
|||||||
function M.start(import, fd, handle)
|
function M.start(import, fd, handle)
|
||||||
local dispatcher = import.dispatch
|
local dispatcher = import.dispatch
|
||||||
skynet_suspend = import.suspend
|
skynet_suspend = import.suspend
|
||||||
|
skynet_resume = import.resume
|
||||||
assert(raw_dispatcher == nil, "Already in debug mode")
|
assert(raw_dispatcher == nil, "Already in debug mode")
|
||||||
skynet.error "Enter debug mode"
|
skynet.error "Enter debug mode"
|
||||||
local channel = debugchannel.connect(handle)
|
local channel = debugchannel.connect(handle)
|
||||||
|
|||||||
Reference in New Issue
Block a user