Skip to main content
number
required
The stack level at which the objects are collected.
number
The index of a specific object on the stack to return. If omitted, the entire stack at the given level is returned as a table.
Alias: getstack

Example debug.getstack returning a table.

This code sample will print all of the objects on the calling function’s stack.

Example debug.getstack returning a singluar object.

This code sample will print a single object that’s on the calling function’s stack.