require "debugger":start "127.0.0.1:12306":event "wait"
print "ok"
function test()
local count = 0
for i=1, 1000 do
count = count + 1
end
end
function example()
require "debugger":attach {}
print("coroutine started")
for i=1,5 do
test()
print("do "..i)
coroutine.yield()
end
print("coroutine finished")
end
local co = coroutine.create(example)
coroutine.resume(co)
coroutine.resume(co)
coroutine.resume(co)
coroutine.resume(co)
coroutine.resume(co)
coroutine.resume(co)
print "down!"
调 require "debugger":attach {} 时,会执行到
这里 get_client 能拿到一个 L(luadbg_State*) 是主线程创建的,然后就被 luadbg_close 掉了