Inspect Manual
Using Inspect With C++
Inspect Manual—429164-006
9-8
C++ Data Types and Inspect
C++ Data Types and Inspect
The following subsections discuss how Inspect handles and presents various C++ data
types.
Bit Fields
Inspect can access C bit fields for display or for expression evaluation. For example, in
these Inspect session the identifiers are binary objects:
Arrays
When you use an array name in an expression, Inspect interprets the array name as a
pointer value. However, when you display an unsubscripted array name, Inspect
displays a pointer value and the contents of the array. For example, assume this C
array declaration:
int z[10]
Inspect would process references to this array in these ways:
If z appears in an expression, the value of z is the address of array element z[0].
If z appears as a display item, Inspect displays the address of array element z[0]
and the contents of array z.
Structure Pointers
If you display a structure pointer but do not also select a field within the referenced
structure, Inspect displays the whole structure. To select a field within the referenced
structure, use the C++ arrow operator; for example:
-COBJ-DISPLAY this->class::field
This example shows how to display a structure and how to display the value of the
pointer to the structure:
-COBJ-DISPLAY *this COMMENT - displays the object
-COBJ-DISPLAY this COMMENT - displays the pointer value
-COBJ-DISPLAY (tstor) ;COMMENT Display value
0
-COBJ-DISPLAY (tstor | tstand ;COMMENT Bitwise OR
1
-COBJ-DISPLAY (tstand & b) ;COMMENT Bitwise AND
1
-COBJ-DISPLAY (tstand ^ b) ;COMMENT Bitwise XOR
0