f78
Print settings
set print address on
For example, the following is what a stack frame display looks like with
set print address off
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
Alternately, you can set GDB to print the source file and line number when it
prints a symbolic 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:
If you have a pointer and you are not sure where it points, try ‘
Other settings control how different kinds of objects are printed:
set print array on
set print pretty off
set print demangle on
set print asm-demangle on
Warning:
set print object on
set print vtbl 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.
#0 set_quotes (lq=0x34c78 "<<", rq=0x34c88 ">>")
at input.c:530
530 if (lquote != def_lquote)
Do not print addresses when displaying their contents. For example, the
following is the same stack frame displayed with set print address off:
(gdb) f
#0 set_quotes (lq="<<", rq=">>") at input.c:530
530 if (lquote != def_lquote)
Show whether or not addresses are to be printed.
Tell GDB to print the source file name and line number of a symbol in the
symbolic form of an address.
Do not print source file name and line number of a symbol. This is the default.
Show whether or not GDB will print the source file name and line number of a
symbol in the symbolic
ffb
form of an address.
Tell GDB to only display the symbolic form of an address if the offset between
the closest earlier 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.
(gdb) p/a ptt
$4 = 0xe008 <t in hi2.c>
For pointers that point to a local variable, ‘p/a’ does not show the symbol name and filename of the referent, even with the
appropriate set print options turned on.
Pretty print arrays. This format is more convenient to read, but uses more
space. The default is off.
Return to compressed format for arrays.
Show whether compressed or pretty format is selected for displaying arrays.
Set a limit on how many elements of an array GDB will print. If GDB is
printing a large array, it stops printing after it has printed the number of elements
set by the set print elements command. This limit also applies to the display of strings. Setting number-of-elements to zero means that the printing is unlimited.
Display the number of elements of a large array that GDB will
ffb
print. If the
number is 0, then the printing is unlimited.
Cause GDB to stop printing the characters of an array when the first NULL is encountered. This is useful when large arrays actually contain only short
strings.
Cause GDB to print structures in an indented format with one member per line,
like the following example:
next = 0x0,
flags = {
sweet = 1,
sour = 1
},
meat = 0x54 "Pork"
}
Cause GDB to print structures in a compact format, like the following example:
meat = 0x54 "Pork"}
Show which format GDB is using to print structures.
Print using only seven-bit characters; if this option is set, GDB displays any
eight-bit characters (in strings or character values) using the notation, \nnn. This setting is best if you are working in English (ASCII) and you use the
high-order bit of characters as a marker or “meta” bit.
Print full eight-bit characters. This allows the use of more international
character sets, and is the default.
Show whether or not GDB is printing only seven-bit characters.
Tell GDB to print unions which are contained in structures. This is the
default setting.
Tell GDB not to print unions which are contained in structures.
Ask GDB whether or not it will print unions which are contained in structures.
For instance, consider the following example’s declarations.
typedef enum {Big_tree, Acorn, Seedling} Tree_forms;
typedef enum {Caterpillar, Cocoon, Butterfly} Bug_forms;
struct thing {
Species it;
union {
Tree_forms tree;
Bug_forms bug;
} form;
};
struct thing foo = {Tree, {Acorn}};
Print C++ names in their source form rather than in the encoded (“mangled”)
form passed to the assembler and linker for type-safe linkage. The default is ‘on’.
Show whether C++ names are printed in mangled or demangled form.
Print C++ names in their source form rather than their mangled form, even in
assembler code printouts such as instruction disassemblies. The default is off.
Show whether C++ names in assembly listings are printed in mangled or
demangled form.
Choose among several encoding schemes used by different compilers to represent
C++ names. The choices for style are currently:
Allow GDB to choose a decoding style by inspecting your program.
Decode based on the GNU C++ compiler (g++) encoding algorithm. This is the default.
Decode based on the Lucid C++ compiler (lcc) encoding algorithm.
Decode using the algorithm in the C++ Annotated Reference Manual.
This setting alone is not sufficient to allow debugging
Show the list of formats.
Display the encoding style currently in use for decoding C++ symbols.
When displaying a pointer to an object, identify the actual (derived) type of the object rather than the declared type, using the virtual function table.
Display only the declared type of objects, without reference to the virtual
function table. This is the default setting.
Show whether actual, or declared, object types are displayed.
Do not pretty print C++ virtual function tables.
Show whether C++ virtual function tables are pretty printed, or not.