2.10.4 Trace Mode Commands When Paused
You can do way more than just press spacebar
when the
tracer is paused at a port. All actions are single-character commands
which are executed
without waiting for a return (unless the command line option
--no-tty
is active). Pressing ?
or h
when paused will print out a list of these commands as well.
2.10.4.1 Control Flow Commands
Abort a Abort Prolog execution (see abort/0) Break b Enter a Prolog break environment (see break/0) Creep c Continue execution, stop at next port. (Also return
,space
)Exit e Terminate Prolog (see halt/0) Fail f Force failure of the current goal Find / Search for a port (see below for the description of this command (section 2.10.4.1)) Ignore i Ignore the current goal, pretending it succeeded Leap l Continue execution, stop at next spy point No debug n Continue execution in’no debug' mode Repeat find . Repeat the last find command (see’Find' (section 2.10.4.1)) Retry r Undo all actions (except for database and I/O actions) back to the call
port of the current goal and resume execution at thecall
portSkip s Continue execution, stop at the next port of this goal (thus skipping all calls to children of this goal) Spy + Set a spy point (see spy/1) on the current predicate. Spy points are described later in the overview (section 2.10.6). No spy - Remove the spy point (see nospy/1) from the current predicate. Spy points are described later in the overview (section 2.10.6). Up u Continue execution, stop at the next port of the parent goal (thus skipping this goal and all calls to children of this goal). This option is useful to stop tracing a failure driven loop.
Find (
) Description and Examples
/
The Find (/
) command continues execution until a port
matching a find pattern is found. After the /
, the user can
enter a line to specify the port to search for. This line consists of a
set of letters indicating the port type, followed by an optional term,
that should unify with the goal run by the port. If no term is specified
it is taken as a variable, searching for any port of the specified type.
If an atom is given, any goal whose functor has a name equal to that
atom matches. Examples:
/f Search for any fail
port/fe solve Search for a fail
orexit
port of any goal with namesolve
/c solve(a, _)
Search for a call to solve/2 whose first argument is a variable or the atom a
/a member(_, _)
Search for any port on member/2. This is equivalent to setting a spy point on member/2.
2.10.4.2 Informational Commands
Alternatives A Show all goals that have alternatives Goals g Show the list of parent goals (the execution stack). Note that due to tail recursion optimization a number of parent goals might not exist any more. Help h Show available options (also ?
)Listing L List the current predicate with listing/1
2.10.4.3 Formatting Commands
Context C Toggle’Show Context'. If on
, the context module of the goal is displayed between square brackets (see modules section (section 6)). Default isoff
.Display d Set the max_depth(Depth)
option of debugger_write_options (section 2.12), limiting the depth to which terms are printed. See also thew
andp
options.p Set the Prolog flag debugger_write_options to [quoted(true), portray(true), max_depth(10), priority(699)]
. This is the default.Write w Set the Prolog flag debugger_write_options to [quoted(true), attributes(write), priority(699)]
, bypassing portray/1, etc.