5.2 Basic Debugging Predicates

Development systems provide a range of built-in predicates for control of the debugging facilities. The most basic predicates are as follows:

debug development
Switches the debugger on, and ensures that the next time control reaches a spypoint, it will be activated. In basic usage this means that a message will be produced and you will be prompted for a command. In order for the full range of control flow information to be available it is necessary to have the debugger on from the start. When it is off the system does not remember invocations that are being executed. (This is because it is expensive and not required for normal running of programs.) You can switch Debug Mode on in the middle of execution, either from within your program or after a ^C (see trace/0 below), but information prior to this will be unavailable.
zip development
Same as debug/0, except no debugging information is being collected, and so is almost as fast as running with the debugger switched off.
trace development
Switches the debugger on, and ensures that the next time control enters an invocation box, a message will be produced and you will be prompted for a command. The effect of trace/0 can also be achieved by typing t after a ^C interruption of a program.

At this point you have a number of options. See Debug Commands. In particular, you can just type <RET> to creep (or single-step) into your program. If you continue to creep through your program you will see every entry and exit to/from every invocation box, including compiled code, except for code belonging to hidden modules (see ref-mod). You will notice that the debugger stops at all ports. However, if this is not what you want, the next predicate gives full control over the ports at which you are prompted.

leash(+Mode) development
Leashing Mode is set to Mode. Leashing Mode determines the ports of invocation boxes at which you are to be prompted when you creep through your program. At unleashed ports a tracing message is still output, but program execution does not stop to allow user interaction. Note that leash/1 does not apply to spypoints, the leashing mode of these can be set using the advanced debugger features; see Advanced Debugging. Block and Unblock ports cannot be leashed. Mode can be a subset of the following, specified as a list of the following:
call
Prompt on Call.
exit
Prompt on Exit.
redo
Prompt on Redo.
fail
Prompt on Fail.
exception
Prompt on Exception.

The following shorthands are also allowed:

leash(all)
Same as leash([exception,call,exit,redo,fail]).
leash(half)
Same as leash([exception,call,redo]).
leash(loose)
Same as leash([exception,call]).
leash(tight)
Same as leash([exception,call,redo,fail]).
leash(off)
Same as leash([]).

The initial value of Leashing Mode is [call,exit,redo,fail,exception] (full leashing).

nodebug development
notrace development
nozip development
Switches the debugger off. Any spypoints set will be kept but will never be activated.
debugging development
Prints information about the current debugging state. This will show:
  1. Whether undefined predicates are being trapped.
  2. What breakpoints have been set (see below).
  3. What mode of leashing is in force (see above).

Send feedback on this subject.