
D-42
Motorola DSP56000 Family Optimizing C Compiler User’s Manual
For More Information On This Product,
Go to: www.freescale.com
Motorola
Examining Data
p *$.next
It might be useful to repeat this command many times by typing RET.
Note:
The history records values, not expressions.
If the value of x is 4 and you type this command:
print x
set x=5
then the value recorded in the value history by the ‘print’ command remains 4 even though
the value of x has changed. See Table D-20.
D.9.8 Convenience Variables
GDB provides
convenience variables
that you can use within GDB to hold on to a value
and refer to it later. These variables exist entirely within GDB; they are not part of your
program, and setting a convenience variable has no effect on further execution of your
program. That’s why you can use them freely.
Convenience variables have names starting with ‘$’. Any name starting with ‘$’ can be
used for a convenience variable, unless it is one of the predefined set of register names
(see section Registers).
You can save a value in a convenience variable with an assignment expression, just as you
would set a variable in your program. Example:
set $foo = *object_ptr
would save in $foo the value contained in the object pointed to by object_ptr.
Using a convenience variable for the first time creates it; but its value is void until you
assign a new value. You can alter the value with another assignment at any time.
Convenience variables have no fixed types. You can assign a convenience variable any
type of value, even if it already has a value of a different type. The convenience variable as
an expression has whatever type its current value has.
Table D-20. Info Commands
Command
Description
info values
Print the last ten values in the value history, with their item numbers. This is like ‘p $$9’
repeated ten times, except that ‘info values’ does not change the history.
info values n
Print ten history values centered on history item number n.
info values +
Print ten history values just after the values last printed.
F
Freescale Semiconductor, Inc.
n
.