Debug
Stack frames, constants, upvalues, and debug information.
21 functions
What the icons meandebug.getcallstackSynchronousCapture visible Luau frames from a coroutine. Use it to print a compact stack trace with function references and current line numbers.
debug.getconstantSynchronousRead one constant stored in a Luau function’s compiled prototype. Use it when inspecting the literal values a function was compiled with.
debug.getconstantsSynchronousRead all constant slots from a Luau function at once. It is useful when exploring a compiled function without guessing which slot contains a literal.
debug.getinfoSynchronousGet a structured description of a function, stack frame, or ProtoProxy. Use it to see source, line, parameter, and upvalue information in one call.
debug.getprotoSynchronousGet one nested Luau prototype from a function. Use the default ProtoProxy for metadata or prototype hooks; request active closures when you need actual live functions.
debug.getprotosSynchronousList the immediate nested prototypes compiled inside a Luau function. This helps you locate a child function before asking for its metadata or installing a proto hook.
debug.getsafeenvSynchronousRead the safe-environment flag of a Luau environment table. It helps diagnose whether a function or coroutine is running with an environment marked safe.
debug.getstackSynchronousRead the register values of a visible Luau stack frame. It helps diagnose an active call when you need its current values, not just the function’s compiled metadata.
debug.getupvalueSynchronousRead the value captured in one upvalue slot of a Luau function. It is useful for checking the state a closure carries without calling it.
debug.getupvaluesSynchronousInspect all captured upvalue slots of a Luau function. Use it to see which outside values a closure currently depends on.
debug.setconstantSynchronousReplace one literal slot in a Luau prototype. This changes code that uses the slot, so save the old value if the edit should be temporary.
debug.setinfoSynchronousUpdate the supported debug metadata of a Luau function or frame. It is useful for giving a generated function a clearer name or source label in later diagnostics.
debug.setprotoSynchronousReplace one nested prototype reference in a Luau function. It affects closures created from that nested slot after the change, so retain a matching original closure if you plan to restore it.
debug.setsafeenvSynchronousSet the safe-environment flag on an environment table. This affects environment handling, so use a table you own and preserve its earlier flag if you need to restore it.
debug.setstackSynchronousWrite one register in a visible Luau stack frame. It is a low-level tool for changing an active call’s state; inspect the slot first and restore it if you only need a temporary probe.
debug.setupvalueSynchronousReplace one value captured by a Luau closure. This lets you change a closure’s state without rebuilding it.
debug.setupvaluenameSynchronousChange the debug name stored for one upvalue slot. This only changes metadata, which can make inspected closures easier to understand.
debug.validlevelSynchronousCheck whether a stack level exists before inspecting it. This is useful in tracing code where callers may have different depths.
isstackhiddenSynchronousCheck whether a function is explicitly marked as hidden from stack inspection. This helps confirm a temporary stack-visibility change was cleared.
setnameSynchronousGive a Luau function a more useful debug name. It is a small convenience wrapper around debug.setinfo for naming generated callbacks.
setstackhiddenSynchronousMark a function’s frames as hidden from Kawaii’s visible stack inspection. Use it to keep a helper frame out of diagnostic call stacks, and clear the flag when finished.