Previous Up Next

4.5  Debugger commands

When the debugger reaches a leashed port it shows the current goal followed by the ? symbol. At this point there are many commands available. Typing RETURN will creep into the program. Continuing to creep will show all the control flow. The debugger shows every port for every predicate encountered during the execution. It is possible to select the ports at which the debugger will prompt the user using the built-in predicate leash/1 (section 4.3.2). Each command is only one character long:

CommandNameDescription
RET or ccreepsingle-step to the next port
lleapcontinue the execution only stopping when a goal with a spy-point is reached
sskipskip over the entire execution of the current goal. No message will be shown until control returns
Ggo toask for an invocation number and continue the execution until a port is reached for that invocation number
rretrytry to restart the invocation of the current goal by failing until reaching the invocation of the goal. The state of execution is the same as when the goal was initially invoked (except when using side-effect predicates)
ffailforce the current goal to fail immediately
wwriteshow the current goal using write/2 (section 7.14.6)
ddisplayshow the current goal using display/2 (section 7.14.6)
pprintshow the current goal using print/2 (section 7.14.6)
eexceptionshow the pending exception. Only applicable to an exception port
gancestorsshow the list of ancestors of the current goal
Aalternativesshow the list of ancestors of the current goal combined with choice-points
uunifyask for a term and unify the current goal with this term. This is convenient for getting a specific solution. Only available at a call port
.father fileshow the Prolog file name and the line number where the current predicate is defined
nno debugswitch the debugger off. Same as nodebug/0 (section 4.3.1)
=debuggingshow debugger information. Same as debugging/0 (section 4.3.1)
+spy thisset a spy-point on the current goal. Uses spy/1 (section 4.3.3)
-nospy thisremove a spy-point on the current goal. Uses nospy/1 (section 4.3.3)
*spy conditionallyask for a term Goal, Port, Test (terminated by a dot) and set a conditional spy-point on the current predicate. Goal and the current goal must have the same predicate indicator. Uses spypoint_condition/3 (section 4.3.3)
Llistinglist all the clauses associated with the current predicate. Uses listing/1 (section 7.23.3)
aabortabort the current execution. Same as abort/0 (section 7.18.1)
bbreakinvoke a recursive top-level. Same as break/0 (section 7.18.1)
@execute goalask for a goal and execute it
<set print depthask for an integer and set the print depth to this value (-1 for no depth limit)
h or ?helpdisplay a summary of available commands
WWAM debuggerinvoke the low-level WAM debugger (section 4.6)

Copyright (C) 1999-2007 Daniel Diaz Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. More about the copyright
Previous Up Next