D-38
Motorola DSP56000 Family Optimizing C Compiler User’s Manual
For More Information On This Product,
Go to: www.freescale.com
Motorola
Examining Data
D.9.5.1 Examining Memory
The command ‘x’ (for ‘examine’) can be used to examine memory without reference to
the program’s data types. The format in which you wish to examine memory is instead
explicitly specified. The allowable formats are a superset of the formats described in the
previous section.
‘x’ is followed by a slash and an output format specification, followed by an expression
for an address. The expression need not have a pointer value (though it may); it is used as
an integer, as the address of a byte of memory. See section Expressions for more
information on expressions. For example, ‘x/4xw $sp’ prints the four words of memory
above the stack pointer in hexadecimal.
The output format in this case specifies both how big a unit of memory to examine and
how to print the contents of that unit. It is done with one or two of the following letters:
These letters listed in Table D-17 specify just the size of unit to examine:
Many assemblers and cpu designers still use ‘word’ for a 16-bit quantity, as a holdover
from specific predecessor machines of the 1970’s that really did use two byte words. But
more generally the term ‘word’ has always referred to the size of quantity that a machine
normally operates on and stores in its registers. This is 32 bits for all the machines that
GDB runs on.
‘
g
’
Examine giant words (8 bytes).
These letters, as listed in Table D-18, specify just the way to print the contents:
Table D-17. Memory Output Format Letters
Format Letters
Description
‘b’
Examine individual bytes.
‘h’
Examine halfwords (two bytes each).
‘w’
Examine words (four bytes each).
Table D-18. Print Output Format Letters
Format Letter
Description
‘x’
Print as integers in unsigned hexadecimal.
‘d’
Print as integers in signed decimal.
‘u’
Print as integers in unsigned decimal.
‘o’
Print as integers in unsigned octal.
F
Freescale Semiconductor, Inc.
n
.