By default, GDB prints a value according to its data type. Sometimes this is not what you want. For example, you might want to print a number in hex, or a pointer in decimal. Or you might want to view data in memory at a certain address as a character string or as an instruction. To do these things, specify an output format when you print a value.
The simplest use of output formats is to say how to print a value
already computed. This is done by starting the arguments of the
(gdb) p/a 0x54320 $3 = 0x54320 <_initialize_vx+396>The command
info symbol 0x54320yields similar results. See section Examining the Symbol Table.
For example, to print the program counter in hex (see section Registers), type
Note that no space is required before the slash; this is because command names in GDB cannot contain a slash.
To reprint the last value in the value history with a different format,
you can use the
Go to the first, previous, next, last section, table of contents.