Debug
Reading and writing constants, upvalues, protos, stack frames, and standard profiling.
Available Functions
| Function | Description |
|---|---|
| debug.getcallstack | Returns a table of the entire stack's information. Table array fields: source (definition), line (start line), what (\"Lua\", \"C\"), name, func. |
| debug.getconstant | Returns a singular constant that's derived from a function. Selected via index. |
| debug.getconstants | Returns a table of constants that's derived from a function. |
| debug.getinfo | Returns a table of information that's derived from a function or stack level. |
| debug.getproto | Gets a cloned proto inside the 'func' unless the 'active' is specified which returns a table of all active protos. |
| debug.getprotos | Return a list of all cloned protos. |
| debug.getregistry | Returns the global registry table. The registry is used to store references. Any object referenced in the registry will never be collected by the garbage collector, as the registry itself will never be collected. Thus a strong reference will always be held. |
| debug.getsafeenv | Returns the safeenv flag. |
| debug.getstack | Returns a table (of the stack) or a singular object from the stack. Only returns objects that are currently on the stack. |
| debug.getupvalue | Returns a singular upvalue that's derived from a function's upvalue list. Selected via index. |
| debug.getupvalues | Returns a table of upvalues from a function's upvalue's list. |
| debug.info | Returns debug information about a given stack frame or function object based on the options string (that can contain characters nslfa). |
| debug.isvalidlevel | Checks if 'level' is valid in the stack |
| debug.profilebegin | Opens a microprofiler label. |
| debug.profileend | Closes the top microprofiler label. |
| debug.setconstant | Sets a singular constant that's derived from a function. Selected via index. |
| debug.setinfo | Sets the debug info around the 'func'. |
| debug.setname | Changes the function name specified to the set one. |
| debug.setsafeenv | Marks the safeenv for an object. |
| debug.setstack | Sets a singular object from the stack. |
| debug.setupvalue | Sets a singular upvalue that's derived from a function's upvalue list. Selected via index. |
| debug.traceback | Returns a string with a traceback of the call stack. The optional message string is appended at the beginning of the traceback. |