5.9.3 Tests Related to the Current Port

These tests can only be used inside the debugger and only when focused on the current invocation. If they appear in execution_state/2 or in execution_state/1 called from outside the debugger, an exception will be raised.

The notion of port in breakpoint handling is more general than outlined earlier in Procedure Box. Here, the following terms are used to describe a port:

     call, exit(nondet), exit(det), redo, fail,
     exception(Exception), block, unblock

Furthermore, the atoms exit and exception can be used in the port condition (see below), to denote either of the two exit ports and an arbitrary exception port, respectively.

port(Port)
The current execution port matches Port in the following sense: either Port and the current port unify, or Port is the functor of the current port (e.g. port(exit) holds for both exit(det) and exit(nondet) ports).

As explained earlier, the port condition for a non Call port is best placed in the action part. This is because the failure of the action part will cause the debugger to pass through the Call port silently, and to build a procedure box, even in zip mode. The following idiom is suggested for creating breakpoints at non Call ports:

          add_breakpoint(Tests-[port(Port),Actions], BID).

bid(BID)
The breakpoint being examined has a breakpoint identifier BID. (BID = off if no breakpoint was selected.)
mode(Mode)
Mode is the value of the mode variable, which normally reflects the current debugger mode.
command(Command)
Command is the value of the command variable, which is the command to be executed by default, if the breakpoint is selected.
show(Show)
Show is the value of the show variable, i.e. the default show method (the method for displaying the goal in the trace message).

The last three of the above tests access the debugger action variables. These breakpoint conditions have a different meaning in the action part. For example, the condition mode(trace), if it occurs in the tests, checks if the current debugger mode is trace. On the other hand, if the same term occurs within the action part, it sets the debugger mode to trace.

To support the querying of the action variables in the action part, the following breakpoint condition is provided:

get(ActVar)
Equivalent to ActVar, where this is an action variable test, i.e. one of the terms mode(Mode), command(Command), show(Show). It has this meaning in the action part as well.

For the port, mode, command and show conditions, the condition can be replaced by its argument, if that is not a variable. For example the condition call can be used instead of port(call). Conditions matching the terms listed above as valid port values will be converted to a port condition. Similarly, any valid value for the three debugger action variables is converted to an appropriate condition. These valid values are described in Action Variables.


Send feedback on this subject.