8.5 Debugger commands

8.5.1 Backtraces

A backtrace is a list of the stack frames starting at the current frame, and continuing down the stack. The backtrace therefore shows the order in which the functions were invoked, starting with the most recent. For instance:

CL-USER 10 > (defun function-1 (a b c)
               (function-2 (+ a b) c))
FUNCTION-1

CL-USER 11 > (defun function-2 (a b) (function-3 (+ a b))) FUNCTION-2 CL-USER 12 > (defun function-3 (a) (/ 3 (- 111 a))) FUNCTION-3 CL-USER 13 > (function-1 1 10 100) Error: Division-by-zero. 1 (abort) return to level 0. 1 return to top loop level 0. Type :c followed by a number to proceed CL-USER 14 : 1 > :bq 10 INVOKE-DEBUGGER <- / <- FUNCTION-3 <- FUNCTION-2 <- FUNCTION 1 <- CCL::DO-EVALUATION <- CCL::%TOP-LEVEL <- CCL::LISTENER-TOP-LEVEL <- LISPWORKS-TOOLS::RUN-LISTENER-TOP-LEVEL <- LISPWORKS-TOOLS::START-LISPWORKS-TOOLS-WITH-HANDLER CL-USER 15 : 1 >

:bq requests a "quick" backtrace. Instead of showing each stack frame fully, this command shows only the function name associated with each of the call frames. The argument, here 10, specifies that only the next ten frames should be displayed, rather than continuing to the bottom of the stack.

Below, all of the backtrace commands are described. The syntax is given on the first line of each description. Square brackets are used to denote optional arguments or keywords. This convention continues throughout the manual.

:b [:verbose] [m] Debugger command

This command obtains a backtrace from the current frame. It may be followed by :verbose, which specifies that a fuller description of each frame be given. This description includes the values of the arguments to the function calls in the backtrace. It may also be followed by a number, m, which specifies the number of frames to be displayed.

:bq [m] Debugger command

This command obtains a quick backtrace from the current stack position. Only call frames are included, and only the names of their associated functions are shown. It may be followed by a number, m, which specifies the number of frames to be displayed.


FreeLisp User's Guide - 5 FEB 1996

Generated with Harlequin WebMaker