Quirrel4.41.0

debug.format_call_stack_string

Defined in module "debug"
from "debug" import format_call_stack_string
format_call_stack_string(): string

Returns a formatted string describing the current call stack

Return value

A multi-line string: one *FUNCTION [name()] source:line line per frame above this call, followed by a LOCALS section listing the local variables visible at every one of those frames.

Example

examples/debug/format_call_stack_string.nut
from "debug" import format_call_stack_string

function inner() {
  return format_call_stack_string()
}

println(inner())
Output:

CALLSTACK
*FUNCTION [inner()] doc/examples/debug/format_call_stack_string.nut:4
*FUNCTION [__main__()] doc/examples/debug/format_call_stack_string.nut:7

LOCALS
[this] NULL
[inner] CLOSURE=FN:inner
[vargv] ARRAY=[]
[this] NULL

See also

getstackinfosReturns call stack information for the given stack level
get_stack_topReturns the current VM stack top index
debugmodule index