actboy168 / lua-debug

Lua Debug Adapter for Visual Studio Code
MIT License
435 stars 94 forks source link

lua5.1 can't get thread status #160

Closed fesily closed 2 years ago

fesily commented 2 years ago
local dbg = require "luadebug" : start "@/Users/apple/func/typescripttolua_test/out/debug.sock" :event "wait"
--dbg:setup_patch()
local fn = coroutine.wrap(function ()
    while true do
        print("1")
         coroutine.yield()
    end
end)
fn()

断点打 print("1")这句话,使用调试器内置的54可以查看到堆栈调用信息,lua51完全看不到


lua54 image lua51 image


如果使用debugger.lua里面自带的setup_patch在任何版本的lua包括内置的lua都无法读取堆栈调用信息.

actboy168 commented 2 years ago

lua5.1内核太落后支持不了这个功能

fesily commented 2 years ago

那好吧,luajit我也就放弃了

fesily commented 2 years ago

我看到3rd/lua/的ldo.c文件的lua_resume函数,修改的部分填错参数了吧?

  luai_threadret(from,L);

应该是

  luai_threadret(L, from);
actboy168 commented 2 years ago

没有错

fesily commented 2 years ago

没转过弯来