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 symbol-filename

Tell GDB to print the source file name and line

on

number of a symbol in the symbolic form of an

 

address.

set print symbol-filename

Do not print source file name and line number

off

of a symbol. This is the default.

show print symbol-filename

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 max-symbolic-offset max-offset

show print max-symbolic-offset

Tell GDB to only display the symbolic form of an address if the offset between the closest symbol and the address is less than max-offset. The default is 0, which tells GDB to always print the symbolic form of an address if any symbol precedes it.

Ask how large the maximum offset is that GDB prints in a symbolic address.

8.7 Print settings

91