trace

The trace command enables you to specify which subjects to trace for a given object (class, instance, or keyword). Subjects include existence, attributes, methods, and events. You can choose to trace all objects by one subject, one object by all subjects, or anything in between.

By default, the tracer traces all classes and instances, and does not trace system items (such as call stacks and event queues), as though you had executed the following command:

   trace #all all

In animation, by default, no items are traced, as though you had executed the following command:

   trace object nothing

Syntax

trace <object> <interest-list>

Arguments

object

Specifies the object to be traced. It can be one of the following items:

Table 1. Possible subjects for trace command
existence constructors
relations destructors
attributes timeouts
states parameters
controls subclasses
methods threads
events  

The keywords all and nothing indicate all or none of these subjects.

Precede a subject with a plus (+) or minus (-) sign to add or subtract subjects from the current interest list. If there is neither a + nor -, the subjects typed become the current interest list, replacing any subjects previously selected.

The subject existence reports on the existence of the object.

The subject subclasses applies the trace commands to all the subclasses of a class. It is relevant only to class objects.

Command semantics

You set or modify the interest list for a given object with the subjects that you list following the name of the object.

Example 1

The following command sets the interest list of B[5] to relations:

trace B[5] relations

The tracer will now display a message every time a relation of object B[5] is modified. For example:

   OMTracer B[5] item A[7] added to relation itsA

Only messages regarding relations are displayed for B[5].

Example 2

The following trace command adds relations to the interest list of B[5]:

trace B[5] +relations 

Other messages regarding B[5] are displayed or not depending on the value of the interest list before the subject addition command was given.

Example 3

The following trace command removes relations from the interest list of B[5]:

trace B[5] -relations 

The effect of this command is that no message is displayed about the relations of object B[5]. Other messages regarding B[5] are displayed or not depending on the value of the interest list before the command was given.

For the full list of messages by subject, see Tracer messages.

Example 4

If all subjects in the interest list appear with a + or - sign, the interest list of the object is modified. For example, the following command adds the subject relations to the interest list of B[5] and removes the subject states:

trace B[5] +relations, -states

In contrast, the following command sets the interest list of B[5] to include exactly the relations and states for the subject:

trace B[5] relations, states

Special Cases

Consider the following special cases when using the trace command:


Feedback