User`s guide
Displaying and Changing Program Variables
43
Suppose a single-precision floating point array is namedfloat_vals. To see the
six consecutive elements beginning with the fifth element, enter:
(dbx) &float_vals[4] / 6f
10012018: 0.25000000000000000 0.20000000298023224 0.16666699945926666
0.14280000329017639
10012028: 0.12500000000000000 0.11111100018024445
Changing the Value of a Variable
The assign command changes the value of existing program variables. You
can also use the assign command to change the value of machine registers, as
described in “Changing Register Values” on page 84.
The syntax of the assign command is:
assign variable = expression
Assigns the value of expression to the program variable,
variable.
For example:
(dbx) assign x = 27
27
(dbx) assign y = 37.5
37.5
If you receive an incompatible types error when you try to assign a value
to a pointer, use casts to make the assignment work. For example if next is a
pointer to a structure of type “element,” you can assign next a null pointer
by entering:
(dbx) assign *(int *) (&next) = 0
0
(dbx) assign next = 0
(nil)
(dbx) assign next = (struct list*) 0;
(nil)
In this example, nil denotes that the value of the pointer is 0; nil is similar
to NULL in the C language.