8 The Debugger

8.2 Entering the debugger

Once the debugger is turned on, it can be entered by causing an error in interpretation or execution of a form. For example:

CL-USER 1 > (defun thing (number)
              (/ number 0))
THING

CL-USER 2 > (thing 12)

Error: Division-by-zero.
  1 (abort) return to level 0.
  2 return to top loop level 0.

Type :c followed by a number to proceed 

CL-USER 3 : 1 >

The call to thing invokes the debugger.

The final prompt in the example contains a 1. The debugger can be entered from within itself, with the prompt showing how many times it has happened. The number is referred to as the current level of the debugger. When it is 1, it is called the top level of the debugger.

So, if an error occurred at the debugger top level, the new prompt would contain a 2. For example:

CL-USER 3 : 1 > (/ 1 0)

Error: Division-by-zero.
  1 (abort) return to level 1.
  2 retrurn to debug level 1.
  3 return to level 0.
  4 return to top level loop 0.

Type :c followed by a number to proceed

CL-USER 4 : 2 >

The debugger returns to the previous level once you have dealt with the error which caused the current invocation. Dealing with an error may mean correcting it or ignoring it: it is entirely your choice.

Note: If the debugger is at its top level (1) and the error is resolved, it exits and returns to the normal Listener mode, which is known as the environment's top level loop and is numbered 0.

If you have run through the example above, type :c 4 now. This exits the debugger so that you are ready to run through the examples that follow.

CL-USER 4 : 2 > :c 4

CL-USER 5 >


FreeLisp User's Guide - 5 FEB 1996

Generated with Harlequin WebMaker