Parameters
Returns
{table} - An array of tables representing each active frame in the thread’s call stack.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
debug.getcallstack(thread: thread?): {table}
| Parameter | Type | Description |
|---|---|---|
thread | thread | (Optional) The thread to inspect. Defaults to the current thread. |
{table} - An array of tables representing each active frame in the thread’s call stack.
local stack = debug.getcallstack()
-- Get call stack of another thread
local thread = coroutine.create(function()
task.wait(1)
end)
task.spawn(thread)
task.wait()
local stack = debug.getcallstack(thread)
print("Target thread stack depth: ", #stack)