4.11.11 Debugging Code in a Module

Having loaded a module to be debugged, you can trace through its execution in the normal way. When the debugger stops at a port, the procedure being debugged is displayed with its module name as a prefix unless the module is user.

The predicate spy/1 depends on the source module. It can be useful to override this during debugging. For example,

     | ?- spy mod1:f/3.

puts a spypoint on f/3 in module mod1.

It can also be useful to call directly a predicate that is private to its module in order to test that it is doing the right thing. This can be done by prefixing the goal with its module; for example,

     | ?- mod1:f(a,b,X).

Send feedback on this subject.