set print address off Do not print addresses when displaying their contents. For example, this is the same stack frame displayed with set print address off:
((gdb)) set print addr off
((gdb)) f
#0 set_quotes (lq="<<", rq=">>") at input.c:530
530 if (lquote != def_lquote)
You can use 'set print address off' to eliminate all machine dependent displays from the GDB interface. For example, with print address off, you should get the same text for backtraces on all machines―whether or not they involve pointer arguments.
show print address | Show whether or not addresses are to be printed. |
When GDB prints a symbolic address, it normally prints the closest previous 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 it. One way to do this is with info line. For example 'info line *0x4537'. Alternately, you can set GDB to print the source file and the line number when it prints a symbolic address:
set print | Tell GDB to print the source file name and line |
on | number of a symbol in the symbolic form of an |
| address. |
set print | Do not print source file name and line number |
off | of a symbol. This is the default. |
show print | Show whether or not GDB will print the source |
| file name and line number of a symbol in the |
| symbolic form of an address. |
Another situation where it is helpful to show symbol filenames and line numbers is when disassembling code. GDB shows you the line number and source file that corresponds to each instruction.
Also, you may wish to see the symbolic form only if the address being printed is reasonably close to the closest earlier symbol:
set print
show print
Tell GDB to only display the symbolic form of an address if the offset between the closest symbol and the address is less than
Ask how large the maximum offset is that GDB prints in a symbolic address.
8.7 Print settings | 91 |