The following is a simple example.
CL-USER 1 > (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 2 > (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.
3 Destroy process.
Type :c followed by a number to proceed
CL-USER 3 : 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:
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
.
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.