Name

print

print [/format] [expression]

Print the value of expression. If the first argument is "/" and format, use the format to print the expression. Omitting expression prints the previous expression, allowing you to use a different format to see the same value. The allowed format values are a subset of the format items for the x command; see also x, later in this section.

Print Formats

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.

o

Print the value as an octal integer.

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.

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.