Inspect Manual

Using Inspect With C
Inspect Manual429164-006
8-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:
This example shows how to display a structure and how to display the value of the
pointer to the structure:
-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
-COBJ-DISPLAY structptr->field
-COBJ-DISPLAY *structptr ;COMMENT - displays the structure
-COBJ-DISPLAY structptr ;COMMENT - displays the pointer value