Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion extension/script/backend/worker/breakpoint.lua
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ function m.exec(bp)
end
return tostring(res)
end)
rdebug.getinfo(1, "Sl", info)
rdebug.getinfo(0, "Sl", info)
stdout(res, info)
Comment on lines +314 to 315
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

将层级从 1 改为 0 解决了记录点显示位置偏移的问题。但考虑到 info 表是模块级共享的(第 12 行定义),如果 rdebug.getinfo 在某些特殊情况下调用失败,info 表中会残留上一次断点触发时的位置信息,导致 stdout 输出错误的位置。建议增加返回值检查,在获取失败时传递空表以确保 stdout 不会使用过时的数据。

        if rdebug.getinfo(0, "Sl", info) then
            stdout(res, info)
        else
            stdout(res, {})
        end

return false
end
Expand Down
Loading