XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next

baktrace


Type:   -   function (subr)
Source:   -   xldbug.c, xlsys.c

Syntax

(baktrace [level])
level - an optional integer expression
returns - NIL

Description

The 'baktrace' function is used to examine the system execution stack from within the break loop. It shows the nested forms that got the system to the current state. The break loop can be entered by a system error, error , cerror or break functions. If the 'levels' parameter is not specified, all the nested forms will be shown back to the main loop form that started the execution. If 'level' is specified the most recent 'level' nested forms will be shown.

Examples

  (defun out (x) (print x) (mid 99))       ; define OUT
  (defun mid (x) (print x) (in 999))       ; define MID
  (defun in (x) (print x) (break "in" x))  ; define IN with a BREAK
  (out 9)                                  ; prints  9
                                           ;         99
                                           ;         999
                                           ; break: in - 999
  (baktrace)                               ; this is done from within break loop
                                           ; prints  Function: #<Subr-BAKTRACE: #22cb4>
                                           ;         Function: #<Subr-BREAK
                                           ;         Arguments:
                                           ;           "in"
                                           ;           999
                                           ;         Function: #<Closure-IN: #2bc44>
                                           ;         Arguments:
                                           ;           999
                                           ;         Function: #<Closure-MID: #2bd20>
                                           ;         Arguments:
                                           ;           99
                                           ;         Function: #<Closure-OUT: #2bec4>
                                           ;         Arguments:
                                           ;           9
                                           ;         NIL

Common Lisp: Common LISP has a similar function called 'backtrace'. For XLISP, 'baktrace' is spelled with no 'c'.

See the baktrace function in the XLISP 2.0 manual.

  Back to Top


XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next