悉野小楼

导航

lua打印堆栈

print(debug.traceback("Stack trace:"))

function func1()
    func2()
end

function func2()
    print(debug.traceback("Stack trace:"))
end

func1()
Stack trace:
    [string "test.lua"]:5: in function 'func2'
    [string "test.lua"]:2: in function 'func1'
    [string "test.lua"]:9: in main chunk
    [C]: in ?

 

posted on 2023-11-21 19:21  悉野  阅读(186)  评论(0编辑  收藏  举报