Debugging with GDB (September 2007)

Chapter 9: Using GDB with Different Languages 89
catch throw
catch catch
Debug C++ exception handling using these commands. See Section 5.1.2 [Set-
ting catchpoints], page 37.
ptype typename
Print inheritance relationships as well as other information for type. typename.
See Chapter 10 [Examining the Symbol Table], page 93.
set print demangle
show print demangle
set print asm-demangle
show print asm-demangle
Control whether C ++ symbols display in their source form, both when displaying
code as C++ source and when displaying disasse mblies. See Section 8.7 [Print
settings], page 70.
set print object
show print object
Choose whether to print derived (actual) or declared types of objects. See
Section 8.7 [Print settings], page 70.
set print vtbl
show print vtbl
Control the format for printing virtual function tables. See Section 8.7 [Print
settings], page 70. (The vtbl commands do not work on programs compiled
with the HP ANSI C++ compiler (aCC).)
set overload-resolution on
Enable overload resolution for C++ expression evaluation. The default is on.
For overloaded functions, GDB evaluates the arguments and searches for a
function whose signature matches the argument types, using the standard C++
conversion rules (see Section 9.4.1.3 [C++ expressions], page 86, for details). If
it cannot find a match, it emits a message.
set overload-resolution off
Disable overload resolution for C++ expression evaluation. For overloaded func-
tions that are not class member functions, GDB chooses the first function of
the specified name that it finds in the symbol table, whether or not its argu-
ments are of the correct type. For overloaded functions that are class member
functions, GDB searches for a function whose signature exactly matches the
argument typ e s.
show overload-resolution
Display current overload resolution setting for C++ expression evaluation.
Overloaded symbol names
You can specify a particular definition of an overloaded symbol, using the same
notation that is used to declare such symbols in C++: type symbol(types )
rather than just symbol. You can also use the GDB command-line word com-
pletion facilities to list the available choices, or to finish the type list for you.
See Section 3.2 [Command completion], page 17, for details on how to do this.