Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.

baktrace

baktrace

type: function (subr)
location: built-in
source file: xldbug.c  and  xlsys.c
Common LISP compatible: related
supported on: all machines

SYNTAX

(baktrace  [ <level> ]  )
        <level>         -       an optional integer expression

DESCRIPTION

The BAKTRACE function is used to examine the system execution stack from within the break look. 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 COMPATIBILITY: Common LISP has a similar function called BACKTRACE. For XLISP, BAKTRACE is spelled with no 'c'.


Go to the first, previous, next, last section, table of contents.