spy/1 development


spy +PredSpecs

Sets spypoints on all the predicates represented by PredSpecs


PredSpecs gen_pred_spec_tree
Single predicate specification of form: Name, or Name/Arity, or a list of such. [MOD]


Turns debugger on in debug mode, so that it will stop as soon as it reaches a spypoint. Turning off the debugger does not remove spypoints. Use nospy/1 or nospyall/0) to explicitly remove them.

Note that since spy is a built-in operator, the parentheses, which usually surround the arguments to a predicate, are not necessary (although they can be used if desired).

If you use the predicate specification form Name but there are no clauses for Name (of any arity), then a warning message will be displayed and no spypoint will be set.

     | ?- spy test.
     % The debugger will first leap -- showing spypoints (debug)
     * There are no predicates with the name test in module user

To place a spypoint on a currently undefined procedure, use the full form Name/Arity; you will still get a warning message, but the spypoint will be set .

     | ?- spy test/1.
     * You have no clauses for user:test/1
     % Spypoint placed on user:test/1
     | ?-

If spy/1 is given any invalid argument it prints a warning.

This predicate is not supported in runtime systems.


if the argument is not ground.
if a Name is not an atom or an Arity not an integer.
if a PredSpec is not a valid procedure specification, or if an Arity is specified as an integer outside the range 0-255.
if a specified procedure is built-in or imported into the source module.

See Also

nospy/1, nospyall/0, debug/0, current_spypoint/1, add_spypoint/1, remove_spypoint/1