|Did you know ...||Search Documentation:|
Port denotes the reason to activate the tracer (`port' in the 4/5-port, but with some additions):
redoport signals resuming a predicate to generate alternative solutions. If PC is 0 (zero), clause indexing has found another clause that will be tried next. Otherwise, PC is the program counter in the current clause where execution continues. This implies we are dealing with an in-clause choice point left by, e.g., ;/2. Note that non-determinism in foreign predicates are also handled using an in-clause choice point.
retry. Except is the pending exception term.
breakinstruction is executed. PC is program counter. This port is used by the graphical debugger.
cut_call(PC)for more information.
Frame is a reference to the current local stack frame, which can be examined using prolog_frame_attribute/3. Choice is a reference to the last choice point and can be examined using prolog_choice_attribute/3. Action must be unified with a term that specifies how execution must continue. The following actions are defined:
Together with the predicates described in section 4.39 and the other predicates of this chapter, this predicate enables the Prolog user to define a complete new debugger in Prolog. Besides this, it enables the Prolog programmer to monitor the execution of a program. The example below records all goals trapped by the tracer in the database.
prolog_trace_interception(Port, Frame, _PC, continue) :- prolog_frame_attribute(Frame, goal, Goal), prolog_frame_attribute(Frame, level, Level), recordz(trace, trace(Port, Level, Goal)).
To trace the execution of‘go' this way the following query should be given:
?- trace, go, notrace.