Migrating from Inspect to Native Inspect

Migrating from Inspect to Native Inspect
4 of 15 Hewlett-Packard Company 543427-002
To list currently set breakpoints, use the
info breakpoints command.
Like Inspect, breakpoints are identified to
related commands using ordinal numbers.
You can apply these commands:
condition breakpoint-ord condition
Add or remove a breakpoint
condition.
ignore breakpoint-ord
Ignore the breakpoint a specified
number of times (Inspect EVERY
clause).
commands breakpoint-ord
Add a list of commands to be
executed when the breakpoint is hit.
To delete breakpoints, use one of these
commands:
delete breakpoint-ord
Delete the
specified
breakpoint.
delete * Delete all
breakpoints.
Gotcha: Inspect uses the c (clear)
command to clear breakpoints. Native Inspect
interprets the c command as the continue
command, which resumes process execution.
To set and clear memory-access breakpoints,
use the mab and dmab commands,
respectively.
Limitation: The memory-access breakpoint is
not currently listed in the breakpoint list nor can
a condition be applied to it.
To enable and disable breakpoints, use these
commands:
enable breakpoint-ord
disable breakpoint-ord
To set a breakpoint that is triggered when a
process ABENDs or stops, use these
commands:
catch abend
catch stop
Displaying Variables
In Native Inspect, you use the print
command to display a variable or the results
of an expression. Unlike Inspect, Native
Inspect does not have any constraints on the
C/C++ expressions that can be evaluated.
You can even perform assignments!
Gotcha: Native Inspect has a display
command, which adds a variable or expression to
the list that is automatically displayed whenever
the program is suspended. While useful, this
behavior is different from the correspondingly
named Inspect command.
Formatting Values
In Inspect, you used the IN clause to control
the display radix. In Native Inspect, you
must specify a /fmt option to the print
command, where fmt has one of these
values:
fmt
Radix
a Address
c Character
d Decimal
f Float
o Octal
t Binary
u Unsigned decimal
x Hexadecimal
For example, print /x ptr
The Inspect DISPLAY AS command
allowed you to format the memory
associated with a variable using the type of
another variable. This command was
commonly used to format the contents of a
raw message buffer using the type of the
structure corresponding to the message. In
Native Inspect, you must use the following
GDB syntax:
print {type}variable
In Native Inspect, unlike Inspect, you can
use C/C++ casts to change the type of a
C/C++ or pTAL variable. For example,
print (char *) StrAddr