Local Lua Debugger for Visual Studio Code
A simple Lua debugger which requires no additional dependencies.
- Debug Lua using stand-alone interpretor or a custom executables
- Supports Lua versions 5.1, 5.2, 5.3 and LuaJIT
- Basic debugging features (stepping, inspecting, breakpoints, etc...)
- Conditional breakpoints
- Debug coroutines as separate threads
- Basic support for source maps, such as those generated by TypescriptToLua
Lua Stand-Alone Interpreter
To debug a Lua program using a stand-alone interpreter, set
lua-local.interpreter in your user or workspace settings:
Alternatively, you can set the interpreter and file to run in
Custom Lua Environment
To debug using a custom Lua executable, you must set up your
launch.json with the name/path of the executable and any additional arguments that may be needed.
"name": "Debug LÖVE",
You must then manually start the debugger in your Lua code:
Note that the path to
lldebugger will automatically be appended to the
LUA_PATH environment variable, so it can be found by Lua.
Requirements & Limitations
- The Lua environment must support communication via stdio.
- Some enviroments may require command line options to support this.
- Ex. the Corona Simulator requires the
- The Lua environment must be built with the
debug library, and no other code should attempt to set debug hooks.
- You cannot manually pause debugging while the program is running.
- In Lua 5.1 and LuaJIT, the main thread cannot be accessed while stopped inside of a coroutine.
- Some custom enviroments do not support stopping on runtime errors.