SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools


GUI Tracer

The GUI Tracer Window

If GUI tracing is enabled, the query

 ?- trace, p(X,Y,Z).

opens the SWI-Prolog GUI tracer as a new window ( A note to Windows users ) that

  1. Shows bindings of variables
  2. Shows the call stack of the running Prolog process
  3. Shows the contents of the prolog source file and the executed goal.
  4. Shows the type of call: initial call (green), redo (yellow), fail (red) and success (blue).

The SWI-Prolog GUI tracer window

The tool bar of the SWI-Prolog GUI tracer offers some useful shortcuts

The SWI-Prolog GUI tracer toolbar.

The buttons in (1) provide - from left to right - the option to show the unifier for the current goal, step into the current goal's execution, step over it or finish the selected goal. The buttons in (2) provide - from left to right – the option to step to the next spy point, add spy points, set a stop at the caret and to remove spy points. For details on other buttons see the respective tool tip.

Inspecting Variable Bindings

If a variable's value is too long to fit in the bindings frame (1) you can view it in full in a separate window by double clicking the variable in (1)

Viewing large variable bindings in the SWI-Prolog GUI-Tracer

Setting Breakpoints

It is also possible to set breakpoints in the Editor. See breakpoints.

ViaEdit > Breakpoints you can define spy points on predicates occurring in the program (by entering the predicate's name/arity and then pressing the left-most button – see red arrow).

Setting breakpoints in the SWI-Prolog GUI-Tracer

research/pdt/docs/gui_tracer.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019