After you turn on the debugger and type the goal you want to debug, the system begins to show the steps of the procedure's execution. As the system passes through each port of a procedure, it displays a debugging message on your terminal.
A sample debugging message and an explanation of its symbols are shown below.
** (23) 0 Call (dynamic): mymodule:foo(hello,there,_123) ?
**
skip
. The possible
combinations are:
**
foo/3
has been spied.)
*>
skip
.
>
skip
.
(23)
0
Call
(dynamic)
built_in
locked
undefined
foreign
dynamic
multifile
mymodule
user
, the module name will be displayed here, followed
by a colon.
foo(hello,there,_123)
print/1
so that all
goals displayed by the debugger can be "pretty printed", if the user wishes,
using portray/1
clauses. The debugger also maintains a print depth limit
and will only show terms nested down to this depth. The system initially
uses a limit of 10, but this can be changed using the < debugging
option.
?
?
is the prompt indicating that you should type in one of
the option codes (see next section). If this particular port is unleashed,
there will be no prompt and the debugger will continue to the next port.
Please note: Since the system does not allow the placing of spypoints on built-in
predicates, the only way to show the execution of built-in predicates typed
at the main Prolog prompt is to select trace mode. For example, if
you typed write(foo). at the main Prolog prompt with the debugger
in debug mode, the system would simply display the word foo
without
tracing the execution of the predicate write/1
.
However, if a built-in predicate
such as write/1
were called from within a program, the execution of the
predicate would be shown in any case that the execution of the procedure
containing it would be shown. There are a few basic built-in predicates for
which information is not displayed because it is more convenient not to
trace them. These are: true/0
, otherwise/0
, false/0
, fail/0
,
=/2
, !/0
(cut), ;/2
(or), ,/2
(and), and
->/2
(local cut).