Next: , Previous: Capturing the Stack or Innermost Stack Frame, Up: Debugging


5.21.6 Examining the Stack

— Scheme Procedure: stack? obj
— C Function: scm_stack_p (obj)

Return #t if obj is a calling stack.

— Scheme Procedure: stack-id stack
— C Function: scm_stack_id (stack)

Return the identifier given to stack by start-stack.

— Scheme Procedure: stack-length stack
— C Function: scm_stack_length (stack)

Return the length of stack.

— Scheme Procedure: stack-ref stack index
— C Function: scm_stack_ref (stack, index)

Return the index'th frame from stack.

— Scheme Procedure: display-backtrace stack port [first [depth [highlights]]]
— C Function: scm_display_backtrace_with_highlights (stack, port, first, depth, highlights)
— C Function: scm_display_backtrace (stack, port, first, depth)

Display a backtrace to the output port port. stack is the stack to take the backtrace from, first specifies where in the stack to start and depth how much frames to display. Both first and depth can be #f, which means that default values will be used. When highlights is given, it should be a list and all members of it are highligthed in the backtrace.