
D-46
Motorola DSP56000 Family Optimizing C Compiler User’s Manual
For More Information On This Product,
Go to: www.freescale.com
Motorola
Altering Execution
D.11.1 Assignment to Variables
To alter the value of a variable, evaluate an assignment expression. See section
Expressions. For example,
print x=4
would store the value 4 into the variable x, and then print the value of the assignment
expression (which is 4).
All the assignment operators of C are supported, including the incrementation operators
‘++’ and ‘--’, and combining assignments such as ‘+=’ and ‘<<=’.
If you are not interested in seeing the value of the assignment, use the ‘set’ command
instead of the ‘print’ command. ‘set’ is really the same as ‘print’ except that the
expression’s value is not printed and is not put in the value history (see section Value
History). The expression is evaluated only for side effects.
Note that if the beginning of the argument string of the ‘set’ command appears identical to
a ‘set’ sub-command, it may be necessary to use the ‘set variable’ command. This
command is identical to ‘set’ except for its lack of sub-commands.
GDB allows more implicit conversions in assignments than C does; you can freely store
an integer value into a pointer variable or vice versa, and any structure can be converted to
any other structure that is the same length or shorter.
To store values into arbitrary places in memory, use the ‘{...}’ construct to generate a
value of specified type at a specified address (see section Expressions). For example,
{int}0x83040 would refer to memory location 0x83040 as an integer (which implies a
certain size and representation in memory), and
set {int}0x83040 = 4
would store the value 4 into that memory location.
D.11.2 Continuing at a Different Address
Ordinarily, when you continue the program, you do so at the place where it stopped, with
the ‘cont’ command. You can instead continue at an address of your own choosing, with
the following commands:
jump linenum
Resume execution at line number
linenum
. Execution may stop immediately if there is a
breakpoint there.
F
Freescale Semiconductor, Inc.
n
.