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. Gdb prints memory addresses showing the location of stack traces, structure values, pointer values, breakpoints, and so forth, even when it also displays the contents of those addresses For example, this is what a stack frame display looks like, with set print address on:
The most common example of it is *argv@argc format if specified, allows overriding the output format used by the command 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. Output formats (debugging with gdb)print using the ‘ raw ’ formatting For example, to print the program counter in hex (see registers), type. By default, gdb prints a value according to its data type
Print settings (debugging with gdb)when gdb prints a symbolic address, it normally prints the closest earlier symbol plus an offset If that symbol does not uniquely identify the address (for example, it is a name whose scope is a single source file), you may need to clarify One way to do this is with info line, for example ‘ info line *0x4537 ’ Alternately, you can set gdb to print the.
OPEN