Migrating from Inspect to Native Inspect
Migrating from Inspect to Native Inspect
Hewlett-Packard Company 543427-002 5 of 15
Pointers
Like GDB, Native Inspect automatically
dereferences C/C++ character pointers
(char *).
Limitation: Whereas pTAL automatically
dereferences pointers, Native Inspect currently
treats them like C/C++ non-character pointers;
you must explicitly dereference them.
Arrays
Native Inspect does not directly support the
Inspect FOR clause. To constrain the number
of array elements displayed, use this
command:
set print elements count
In C/C++ and pTAL programs, you can also
use the GDB “array operator” to specify the
subscript at which array display is to stop.
For example,
print array@4
Native Inspect compresses repeated array
elements, displaying the element value
followed by the count. This command
controls the number of values that must be
repeated before they are compressed:
set print repeats count
Expressions
The Native Inspect print command
accepts expressions in addition to variables.
Unlike Inspect, you do not need to enclose
expressions in parenthesis.
Variable Address
To obtain the address of a variable, use the
C/C++ & operator or the info address
command. In COBOL programs, you can
use the ADDRESS OF operator.
Variable Type
Instead of the Inspect INFO IDENTIFIER
command, Native Inspect provides several
commands for obtaining type information
about a variable:
ptype variable
whatis variable
Auto Display
In Inspect, you could use the SET STATUS
ACTION command to execute display
commands that automatically displayed
“interesting” variables each time a program
is suspended. In Native Inspect, use the
display command to add a variable or
expression to the “auto display list,” each
item of which is displayed when the
program is suspended.
Other useful commands:
display List items on the
auto display list.
delete display ordinal
Delete the
specified item
from the list.
enable ordinal
Enable display of
the specified item.
disable ordinal
Disable display of
the specified item.
New Commands
Native Inspect provides several capabilities
not found in Inspect:
info locals Display all local
variables.
info args Display arguments
to the current stack
frame.
info variables pattern
List all variables
matching pattern.
Scoping
Native Inspect does not support Inspect’s
ability to access static variables contained in
inactive scopes (procedures or functions for
which there is no instance on the call stack).
Specifically, with Inspect you could use the
scope command to select the scope or you
could qualify the variable name with the
name of the containing scope.










