Name
x
x [[/NFU
]addr
]
Examine the data at address. Subsequent x
commands without an address move forward in memory according to the values for N, F, and U.
The N value is a repeat count, for example, to examine a given number of instructions. The F value is a format, indicating how to print the data. The U value is the unit size in bytes of the items to be displayed.
GBD stores the address printed by the x
command in the $_
convenience variable. It stores the contents of the address in the $_ _
convenience variable.
Format Values
a
Print the value as an address. The address is printed as both an absolute (hexadecimal) address and as an offset from the nearest symbol.
c
Print the value as a character constant.
d
Print the value as a signed decimal integer.
f
Print the value as a floating-point number.
i
Print the value as a machine instruction.
o
Print the value as an octal integer.
s
Print the value as a NUL-terminated string.
t
Print the value as a binary integer (
t
stands for “two”).u
Print the value as an unsigned decimal integer.
x
Print the value as a hexadecimal integer.
Unit Size Values
b
Bytes.
g
Giant words, i.e., 8 bytes.
h
Halfwords, i.e., 2 bytes.
w
Words, i.e., 4 bytes.
Get GDB Pocket Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.