Development systems provide a range of built-in predicates for control of the debugging facilities. The most basic predicates are as follows:
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
trace/0 below), but information prior to this will be
debug/0, except no debugging information is being
collected, and so is almost as fast as running with the debugger
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
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, then 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, then the next predicate gives full control over the ports at which you are prompted. See mpg-ref-trace.
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
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:
Prompt on Call.
Prompt on Exit.
Prompt on Redo.
Prompt on Fail.
Prompt on Exception.
The following shorthands are also allowed:
The initial value of Leashing Mode is
[call,exit,redo,fail,exception] (full leashing).
Switches the debugger off. Any spypoints set will be kept but will never be activated.
Prints information about the current debugging state. This will show: