Skip to content
Debug libraryOverviewNew · 0.744

debug.getcallstack

Describe the current chain of function calls.

Details#

Returns an array of current frame metadata: source, short_src, what, name, currentline, linedefined and level. The result describes active calls, not an execution history or a snapshot of locals.

Examples#

Example

Luau
for _, frame in ipairs(debug.getcallstack()) do
    print(frame.level, frame.name, frame.currentline)
end