Next: 4.6 Examining Tables and
Up: 4 Debugging
Previous: 4.4 Examining the Stack
Two commands, print and x are available to examine memory. x displays
the contents of the address specified and print displays the address.
Thus the following two commands are the same:
print *address
x address
Each command allows the specification of a modifier that determines how
the memory should be interpreted.
For example:
- To display the contents of ``VariableA'' as a byte:
x/b VariableA
- To display the contents of ``VariableA'' as a 16-bit word:
x/w VariableA
- To display the contents of ``VariableA'' as a 32-bit long word:
x/x VariableA
- To display the next ten instructions after the current address:
x/10i .
The last example of the previous group shows that you can specify a count
as well as a format for dumping memory contents. Table 4.2 lists
all of the format specifiers:
SPECIFIER | MEANING |
x | hexidecimal 32-bit longwords |
d | decimal 32-bit longwords |
w | hexidecimal 16-bit words |
b | hexidecimal 8-bit byte |
i | instructions |
s | string |
c | ASCII character |
Table 4.2:
Format Specifiers
Next: 4.6 Examining Tables and
Up: 4 Debugging
Previous: 4.4 Examining the Stack
Send corrections/suggestions via e-mail to: Rob Penrose