12.2 Tracing methods

It is often useful to inspect the execution of a particular method. Suppose we want to monitor geometry-changes of graphical objects. The utility predicate tracepce/1 (see also section D) may be used:

1 ?- tracepce((graphical->geometry)).
Trace method: graphical ->geometry

As -> is a standard Prolog operator with priority over 1000, tracepce/1 requires two brackets. Get-methods may be specified in a similar way. <- is not an operator. It is suggested to define <- as an infix operator in the XPCE initialisation file, so this operator is available during program development:

:- op(100, xfx, <-).

Instance variables may be specified as <class>-<variable>. A trace-point on an instance variable makes both reading and writing the variable visible.

The predicate notracepce/1 disables a tracepoint.