debug.getcallstack
Returns metadata for visible Lua call frames.
Syntax
debug.getcallstack(thread: thread?) -> {table}
Also available as
getcallstackget_callstack
Parameters
| Parameter | Type | Description |
|---|---|---|
thread | thread? | Thread to inspect; omit for the current thread. |
Returns
| Type | Description |
|---|---|
{table} | Visible frame records. |
Description
Each entry exposes func; Lua frames can also include currentline. A supported thread may be supplied to inspect its stack. C frames do not provide a Lua source line. The result is a snapshot and is not a way to resume or modify a thread.
Example
for index, frame in debug.getcallstack() do
print(index, frame.func, frame.currentline)
end
Notes
- Following the complete chain of original linked threads is not guaranteed.
These are Game executor contracts. Check build requirements and session lifetimes before using them.
