Next Prev Up Top Contents Index

trace-on-access

Function
Summary

Invokes the trace facilities when an instance of a class is accessed.

Package

clos

Signature

trace-on-access instance &key read write slot-names break => t

Arguments

The keyword arguments control which type of access are traced:

read

Non- nil means trace reading a slot. The default is t .

write

Non- nil means trace writing a slot. The default is t .

slot-names

t means trace access to all slots, otherwise this should be a list of symbols which are the slot-names on which to trace access. The default is t .

break

When non- nil , the debugger is entered. When nil , messages are printed to *trace-output* .

A common use of this function is to find where a slot is being changed in a complex program.

Values

Returns t .

Description

A useful debugging function which causes access to instance to invoke the trace facilities. Accesses include calls to slot-value and accessor functions defined by the class of instance . Other instances of the same class are unaffected and your can remove the trace by calling untrace-on-access. Breaks to the debugger when a traced slot in instance is accessed with break non- nil .

This function, when used with the break keyword, replaces the deprecated function break-on-access.

See also
untrace-on-access
trace-new-instances-on-access
break-on-access

LispWorks Reference Manual - 25 Jul 2003

Next Prev Up Top Contents Index