Debug in Lua
This document introduces 2 simple methods to debug Lua code.
debug library
function myfunction ()
print(debug.traceback("Stack trace"))
print(debug.getinfo(1, "Sl"))
print("Stack trace end")
return 10
end
myfunction ()
print(debug.getinfo(1))
n
selects fields name and namewhatf
selects field funcS
selects fields source, short_src, what, and linedefinedl
selects field currentlineu
selects field nup
clidebugger
https://github.com/ToddWegner/clidebugger
Reference
https://www.lua.org/pil/23.html
https://www.tutorialspoint.com/lua/lua_debugging.htm
Disclaimer
- License under
CC BY-NC 4.0
- Copyright issue feedback
me#imzye.me
, replace # with @ - Not all the commands and scripts are tested in production environment, use at your own risk
- No privacy information is collected here