Category
Debug
Runtime inspection and debug utilities.Category guide
Overview
Use this overview to understand the category before opening a specific function.- See what this group of functions is meant to solve.
- Compare function names and descriptions in one table.
- Open a function for syntax, arguments, returns, and examples.
Debug
Available functions
| Function | Description |
|---|---|
getconstant | Reads a constant from a function, stack level, or prototype by one-based index. |
getconstants | Returns all constants embedded in a function, stack level, or prototype. |
getinfo | Returns debug metadata for a function or stack level. |
getproto | Returns a nested prototype from a function by one-based index. |
getprotos | Returns all nested prototypes found in a function. |
getreg | Returns the Luau registry table exposed to the executor. |
getstack | Reads stack values from a stack level, or one stack slot when an index is provided. |
getupvalue | Reads an upvalue from a function by one-based index. |
getupvalues | Returns all upvalues captured by a function. |
isvalidlevel | Checks whether a stack level can be inspected safely. |
setconstant | Replaces a constant in a function or prototype by one-based index. |
setstack | Replaces a stack slot value at the selected stack level. |
setupvalue | Replaces an upvalue in a function by one-based index. |