A debugger for Luau with debug adapter protocol(DAP) support.
└── luau_debugger
|
├── debugger # Debugger implementation, include a DAP server and
| # a debugger implemented with luau internal debug
| # api directly without hooking
|
├── luaud # A minimal Luau executable with debug support
├── extensions # VSCode extension for Luau debugger
└── tests # Test lua scripts
- Clone
cppdap
andluau
repository to local - Build using CMake Presets with CLI or preset, for example with CLI:
cmake -DLUAU_ROOT=<luau path> -DCPP_DAP_ROOT=<cppdap path> -S . -B build
cmake --build
See features
See luaud for how to integrate with luau-debugger
in your project.
Tips:
- To avoid debug info to be stripped by luau compiler,
Luau::CompileOptions::debugLevel
should be set to2
- Call
Debugger::initialize(lua_State* L)
to initialize the debugger - Call
Debugger::onLuaFileLoaded(lua_State* L, std::string_view path, bool is_entry)
when lua file entry is loaded and lua files are required - Call
Debugger::listen()
to start the DAP server - Call
Debugger::onError(std::string_view msg, lua_State* L)
if you want to redirect lua error message to debug console