All Manuals > LispWorks User Guide and Reference Manual > 3 The Debugger

NextPrevUpTopContentsIndex

3.1 Entering the REPL debugger

The following is a simple example.

CL-USER 2 > (defun make-a-hippo (name weight)
              (if (numberp weight)
                  (make-animal 'hippo name weight)
                (error "Argument to make-a-hippo not a number")))
MAKE-A-HIPPO
 
CL-USER 3 > (make-a-hippo "Hilda" nil)
 
Error: Argument to make-a-hippo not a number
  1 (abort) Return to level 0.
  2 Return to top loop level 0.
 
Type :b for backtrace or :c <option number> to proceed.
Type :bug-form "<subject>" for a bug report template or :? for other options.
 
CL-USER 4 : 1 > 

The call to error causes entry into the debugger. The final prompt in the example contains a 1 to indicate that the top level of the debugger has been entered. The debugger can be entered recursively, and the prompt shows the current level. Once inside the debugger, you may use all the facilities available at the top-level in addition to the debugger commands.

The debugger may also be invoked by using the trace facility to force a break at entry to or exit from a particular function.

The debugger can also be entered by a keyboard interrupt. Keyboard interrupts are generated by the break gesture, which varies between the supported systems as follows:

Microsoft Windows

Ctrl+Break

GTK and Motif

Meta+Ctrl+C

Break if keyboard has that key. Note that PC keyboards do not have Break, only Ctrl+Break, which is different. See also capi:set-interactive-break-gestures.

Cocoa

Command+Control+, (comma). This is only supported on Mac OS X 10.4 and newer.

When the break gesture is used, LispWorks attempts to find a busy process to break. If there is no obvious candidate and the LispWorks IDE is running, then it displays the Process Browser tool.


LispWorks User Guide and Reference Manual - 13 Feb 2015

NextPrevUpTopContentsIndex