Debugging with GDB Manual The GNU Source-Level Debugger (769148-001, March 2014)

Bug_forms;
struct thing {
Species it;
union {
Tree_forms tree;
Bug_forms bug;
} form;
};
struct thing foo = {Tree, {Acorn}};
with set print union on in effect 'p foo' would print
$1 = {it = Tree, form = {tree = Acorn, bug =
Cocoon}}
and with set print union off in effect it would print
$1 = {it = Tree, form = {...}}
These settings are of interest when debugging C++ programs:
set print demangle, set
print demangle on
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 print demangle Show whether C++ names are printed in mangled or
demangled form.
set print asm-demangle, set
print asm-demangle on
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 print asm-demangle Show whether C++ names in assembly listings are printed
in mangled or demangled form.
set demangle-style style Choose among several encoding schemes used by different
compilers to represent C++ names.
On HP-UX, HP WDB automatically chooses the appropriate
style.
The choices for style currently supported are:
auto Allow GDB to choose a decoding style by
inspecting your program.
gnu Decode based on the GNU C++ compiler (g++)
encoding algorithm.
hp Decode based on the HP aC++ (aCC) encoding
algorithm.
lucid Decode based on the Lucid C++ compiler (lcc)
encoding algorithm.
arm Decode using the algorithm in the C++ Annotated
Reference Manual.
WARNING! This setting alone is not sufficient
to allow debugging cfront generated
executables. GDB would require further
enhancement to permit that.
If you omit style, you will see a list of possible
formats.
66 Examining Data