Product Site

5.4.25. TraceObject Class

The TraceObject class subclasses StringTable (a MapCollection) and uses unique character strings for its indexes. It gets used to store trace related information including execution context information that may be helpful to trace and to debug (multithreaded) programs.

When TRACE is active (cf. TRACE keyword instruction and TRACE() built-in-function (BIF)) an instance of this class gets created for each traced clause and the traced context information gets filled in (cf. new class method).
Table 5.60. TraceObject Class

By default the created TraceObject instance gets sent to the .traceOutput monitor for displaying its string value (the instance will get the makeString message sent and as a result returns a string representing it, cf. makeString and makeStringImpl below). The TraceObject class attribute option controls globally how the trace line gets formatted.

The TraceObject class attribute collector can be used to collect all created traceObjects and analyze them programmatically at a later time. If you need a real-time full inspection capability, then use the TraceObject class attribute collector instead. For further information about debugging multithreaded programs using TRACE and this class see Debugging Multithreaded Programs.

The trace infrastructure of ooRexx will create an instance for each trace line and store the following information with the following indexes:
"ATTRIBUTEPOOL"

a number (identifier), makeStringImpl prepends it with the letter A
"CALLERSTACKFRAME"

the caller's StackFrame object information (created for an invocation entry) stored in a StringTable having the following entries:
"ARGUMENTS"

an array of arguments
"EXECUTABLE"

the routine or method object that gets executed
"INVOCATION"

the invocation ID (a number) of the caller that caused this invocation to be created and run, or .nil (e.g., if compiled code)
"LINE"

the current line number or .nil (e.g., if compiled code)
"NAME"

the name associated with the stack frame context
"THREAD"

the thread ID (a number) of the caller in case it used a REPLY keyword instruction or a START message to create (spawn) a new thread of execution
"TRACELINE"

the traceline of the stack frame
"TYPE"

one of COMPILE, INTERNALCALL, INTERPRET, METHOD, PROGRAM, or ROUTINE
"TARGET"

if executable is a method routine, the object to which the message got sent to, or .nil else
"HASSCOPELOCK"

.true/.false, makeStringImpl uses an asterisk *, if .true, a blank character else
"INTERPRETER"

a number (identifier), makeStringImpl prepends it with the letter R
"INVOCATION"

a number (identifier), makeStringImpl prepends it with the letter I
"ISGUARDED"

.true/.false, makeStringImpl uses the letter G, if .true, the letter U else
"ISWAITING"

.true/.false, makeStringImpl uses a W, if .true (object is waiting for guard lock condition to turn .true), a blank character else (needs TRACE RESULT or TRACE INTERMEDIATES to be in effect)
"NUMBER"

a sequential number based on the class attribute counter (used for the default sorting)
"OPTION"

the option at creation time, e.g. N or S
"RECEIVER"

the receiver object for which the method runs
"SCOPELOCKCOUNT"

a number, makeStringImpl prepends it with the letter L
"STACKFRAME"

the trace line's StackFrame object information stored in a StringTable having the following entries:
"ARGUMENTS"

an array of arguments
"EXECUTABLE"

the routine or method object that gets executed
"INVOCATION"

the invocation ID (a number) of the stack frame, or .nil (e.g., if compiled code)
"LINE"

the current line number or .nil (e.g., if compiled code)
"NAME"

the name associated with the stack frame context
"TRACELINE"

the traceline of the stack frame
"TYPE"

one of COMPILE, INTERNALCALL, INTERPRET, METHOD, PROGRAM, or ROUTINE
"TARGET"

if executable is a method routine, the object to which the message got sent to, or .nil else
"THREAD"

a number (identifier), makeStringImpl prepends it with the letter T
"TIMESTAMP"

the creation DateTime
"TRACELINE"

the trace line string used if the class attribute option is set to N (normal)
"VARIABLE"

the traced variable (needs TRACE INTERMEDIATES to be in effect), where further information is available in the StringTable having the following entries:
"NAME"

the name of the variable
"VALUE"

the value of the variable
"ASSIGNMENT"

.true if the value got assigned to the variable, .false if the value was retrieved from the variable