2.10 Overview of the Debugger
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Overview
        • Overview of the Debugger
          • The Byrd Box Model And Ports
          • Trace Mode Example
          • Trace Mode Options: leash/1 and visible/1
          • Trace Mode Commands When Paused
            • Control Flow Commands
            • Informational Commands
            • Formatting Commands
          • Trace Mode vs. Trace Point
          • Spy Points and Debug Mode
          • Breakpoints
          • Command Line Debugger Summary
    • Packages

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 aAbort Prolog execution (see abort/0)
Break bEnter a Prolog break environment (see break/0)
Creep cContinue execution, stop at next port. (Also return, space)
Exit eTerminate Prolog (see halt/0)
Fail fForce failure of the current goal
Find /Search for a port (see below for the description of this command (section 2.10.4.1))
Ignore iIgnore the current goal, pretending it succeeded
Leap lContinue execution, stop at next spy point
No debug nContinue execution in’no debug' mode
Repeat find .Repeat the last find command (see’Find' (section 2.10.4.1))
Retry rUndo all actions (except for database and I/O actions) back to the call port of the current goal and resume execution at the call port
Skip sContinue 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 uContinue 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:

/fSearch for any fail port
/fe solveSearch for a fail or exit port of any goal with name solve
/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 AShow all goals that have alternatives
Goals gShow 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 hShow available options (also ?)
Listing LList the current predicate with listing/1

2.10.4.3 Formatting Commands

Context CToggle’Show Context'. If on, the context module of the goal is displayed between square brackets (see modules section (section 6)). Default is off.
Display dSet the max_depth(Depth) option of debugger_write_options (section 2.12), limiting the depth to which terms are printed. See also the w and p options.
Print pSet the Prolog flag debugger_write_options to [quoted(true), portray(true), max_depth(10), priority(699)]. This is the default.
Write wSet the Prolog flag debugger_write_options to [quoted(true), attributes(write), priority(699)], bypassing portray/1, etc.