Debugging with GDB Manual (5900-1473; WDB 6.2; January 2011)

Table Of Contents
disable display dnums... Disable the display of item numbers dnums. A
disabled display item is not printed automatically,
but is not forgotten. It may be enabled again later.
enable display dnums... Enable display of item numbers dnums. It
becomes effective once again in auto display of
its expression, until you specify otherwise.
display Display the current values of the expressions on
the list, just as is done when your program stops.
info display Print the list of expressions previously set up to
display automatically, each one with its item
number, but without showing the values. This
includes disabled expressions, which are marked
as such. It also includes expressions which would
not be displayed right now because they refer to
automatic variables not currently available.
If a display expression refers to local variables, then it does not make sense outside the
lexical context for which it was set up. Such an expression is disabled when execution
enters a context where one of its variables is not defined. For example, if you give the
command display last_char while inside a function with an argument last_char,
GDB displays this argument while your program continues to stop inside that function.
When it stops elsewhere, where there is no variable last_char, the display is disabled
automatically. The next time your program stops where last_char is meaningful, you
can enable the display expression again.
8.7 Print settings
GDB provides the following ways to control how arrays, structures, and symbols are
printed.
These settings are useful for debugging programs in any language:
set print subcommand This command is a generic command to set or change
the print settings. It must always combine with a
subcommand as shown in the following commands.
show print Displays the print settings of all the print
subcommands.
set print address, set
print address on
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. The default is on. For
example, this is what a stack frame display looks like
with set print address on:
((gdb)) f
#0 set_quotes (lq=0x34c78 "<<", rq=0x34c88
8.7 Print settings 83