Builtin Library
README.md
debugger Module
Public Luau surface over the __debugger Internal FFI namespace —
breakpoints, stepping, stack inspection, watches, pause-on-error.
Purpose
Wrap the raw __debugger.* FFI namespace in a typed Luau table that
gets auto-injected as _G.debugger via the prelude. The core
debugger lives in crate::debugger; this wrapper is the typed
marshalling boundary.
See docs/specs/debugger.md for the full surface contract.
Usage
-- Breakpoints
local bp = debugger.setBreakpoint("/zero/source/main.luau", 42)
debugger.removeBreakpoint(bp.id)
for _, b in ipairs(debugger.listBreakpoints()) do print(b.path, b.line) end
-- Stepping (from a UI pause handler)
debugger.onBreak(function(info) print("paused:", info.path, info.line, info.reason) end)
debugger.stepOver()
debugger.continue_() -- `continue` is a Luau keyword; alias
-- Evaluation
local v, err = debugger.evaluate("self.entityId", 1)
-- Watches
local id = debugger.addWatch("self.public.health")
local watches = debugger.getWatches()
Exports
- Breakpoints:
setBreakpoint,removeBreakpoint,toggleBreakpoint,listBreakpoints,enableAll,disableAll. - Stepping:
continue_(ordebugger["continue"]),stepOver,stepInto,stepOut. - Pause:
isPaused,getPauseInfo,getStack,getLocals,getUpvalues,evaluate. - Watches:
addWatch,removeWatch,getWatches,getWatchValue. - Pause-on-error:
setPauseOnError,isPauseOnError. - Callbacks:
onBreak,onResume,disconnect. - Diagnostics:
__diagnostics.