5.9.9 The Action Variables

In this section we list the possible values of the debugger action variables, and their meaning.

Note that the Prolog terms, supplied as values, are copied when a variable is set. This is relevant primarily in the case of the proceed/2 and flit/2 values.

Values allowed in the show condition:

print
Write using options stored in the debugger_print_options Prolog flag.
silent
Display nothing.
display
Write using display.
write
Write using writeq.
write_term(Options)
Write using options Options.
Method-Sel
Display only the subterm selected by Sel, using Method. Here, Method is one of the methods above, and Sel is a subterm selector.

Values allowed in the command condition:

ask
Ask the user what to do next.
proceed
Continue the execution without interacting with the user (cf. unleashing).
flit
Continue the execution without building a procedure box for the current goal (and consequently not encountering any other ports for this invocation). Only meaningful at Call ports, at other ports it is equivalent to proceed.
proceed(Goal,New)
Unless at call port, first go back to the call port (retry the current invocation, see the retry(Inv) command value below). Next, unify the current goal with Goal and execute the goal New in its place. Create (or keep) a procedure box for the current goal.

This construct is used by the `u' (unify) interactive debugger command.

Both the Goal and New arguments are module name expanded when the breakpoint is added: the module of Goal defaults to the module of the current goal, while that of New to the module name of the breakpoint spec. If the command value is created during run time, the module name of both arguments defaults to the module of the current goal.

The term proceed(Goal,New) will be copied when the command action variable is set. Therefore breakpoint specs of form

          Tests - [goal(foo(X)),...,proceed(_,bar(X))]
     

should be avoided, and

          Tests - [goal(foo(X)),...,proceed(foo(Y),bar(Y))
     

should be used instead. The first variant will not work as expected if X is non-ground, as the variables in the bar/1 call will be detached from the original ones in foo/1. Even if X is ground, the first variant may be much less efficient, as it will copy the possibly huge term X.

flit(Goal,New)
Same as proceed(Goal,New), but do not create (or discard) a procedure box for the current goal. (Consequently no other ports will be encountered for this invocation.)

Notes for proceed/2, on module name expansion and copying, also apply to flit/2.

exception(E)
Raise the exception E.
abort
Abort the execution.
retry(Inv)
Retry the most recent goal in the backtrace with an invocation number less or equal to Inv (go back to the Call port of the goal). This is used by the interactive debugger command `r', retry; see Debug Commands.
reexit(Inv)
Re-exit the invocation with number Inv (go back to the Exit port of the goal). Inv must be an exact reference to an exited invocation present in the backtrace (exited nondeterminately, or currently being exited). This is used by the interactive debugger command `je', jump to Exit port; see Debug Commands.
redo(Inv)
Redo the invocation with number Inv (go back to the Redo port of the goal). Inv must be an exact reference to an exited invocation present in the backtrace. This is used by the interactive debugger command `jr', jump to Redo port; see Debug Commands.
fail(Inv)
Fail the most recent goal in the backtrace with an invocation number less or equal to Inv (transfer control back to the Fail port of the goal). This is used by the interactive debugger command `f', fail; see Debug Commands.

Values allowed in the mode condition:

qskip(Inv)
Quasi-skip until the first port with invocation number less or equal to Inv is reached. Having reached that point, mode is set to trace. Valid only if \Inv \geq 1 and furthermore \Inv \leq \CurrInv for entry ports (Call, Redo), and \Inv < \CurrInv for all other ports, where CurrInv is the invocation number of the current port.
skip(Inv)
Skip until the first port with invocation number less or equal to Inv is reached, and set mode to trace there. Inv should obey the same rules as for qskip.
trace
Creep.
debug
Leap.
zip
Zip.
off
Continue without debugging.

Send feedback on this subject.