FreeLisp User's Guide
Sometimes you will be immediately able to see what is causing a bug in a program, and correcting it will be trivial. For example, you might make a spelling mistake whilst typing, which you may instantly notice and correct.
More often, however, you will need to spend time studying the program and the errors it caused before you can debug it. This is especially likely when you are developing large or complicated programs.
The FreeLisp environment provides a tool which will help you debug programs easily and quickly. This tool is the debugger, and is used within the listener.
The debugger can be used to inspect the behavior of programs which behave in unexpected ways, and to analyze programs which cause unreasonable conditions when they are run, or which contain Common Lisp forms which are syntactically incorrect, that is, non-legal.
Such errors are recognized immediately by the environment. After starting FreeLisp, the default behavior when an error occurs is to stop execution and report it.
You can change this behavior so that the debugger is invoked automatically whenever errors occur. There are two ways of doing this:
freelisp
called freelisp.ini
. If you edit the contents of this file appropriately, the default Debugger setting can be changed from off to on. Then, whenever the environment starts, the debugger will be invoked automatically when an error occurs.The line which should be changed normally reads:
DEBUGGER=OFFAutomatic debugger-entry can be achieved by changing this to
DEBUGGER=ONand then starting the environment.
You can turn the debugger on and off during your session by using two functions. The first,
(debug-on)turns the debugger on, so that it is entered whenever an error occurs. The second,
(debug-off)turns it off again.
Alternatively, choose Debugger from the Customize menu on the Listener. This toggles the state of the debugger, so that it is either turned on or off, as is appropriate.
Generated with Harlequin WebMaker