Inspect Manual
Using Inspect With C
Inspect Manual—429164-006
8-3
Usage Considerations
( ) qualifies the line number by the source file containing it. Use this option only
if the source code for the given function is in more than one file.
FROM module
specifies the module in which the function containing the code location is defined.
In HP C, the module name is the file name of the module’s base source file (the file
specified as input to the HP C compiler). Use the FROM clause only if you have
two functions of the same name.
offset
specifies an offset from the code location defined by the preceding options. A
positive offset denotes code following the specified code location; a negative offset
denotes code preceding the specified code location. The amount to offset is
specified as a given number of units. If you omit the unit specifier, Inspect selects
a default unit of STATEMENT for C programs. Inspect code units correspond to C
code units as follows:
INSTRUCTION Specifies a machine-code instruction in compiled C program.
STATEMENT Specifies a C statement.
VERB Specifies a C statement, as does STATEMENT.
Usage Considerations
Low-level code locations
Low-level Inspect recognizes function names, but does not use any other symbol
information. In low-level Inspect, therefore, you can only use code locations of the
form:
#scope-path [ code-offset ]
This form represents an offset from the code base of a function. Also, the code
unit of code-offset in low-level Inspect is always INSTRUCTION.
High-level code locations
High-level Inspect recognizes function names as does low-level Inspect, but it also
uses the symbol information created when you compile a function with the
SYMBOLS pragma. Therefore, code locations in high-level Inspect can include
label identifiers or line numbers.
Specifying code locations by label
You can use a C label as the code reference in a code location. However, because
Inspect also accepts scope units as code references, a conflict arises if a label’s
identifier is the same as the identifier for its containing function. Inspect interprets
the identifier as a reference to the function, not to the label. Consequently, you
must specify the code location of the label by its statement number, its line number,
or its instruction offset.