Debugging with GDB (February 2008)

Table Of Contents
Chapter 14: HP-UX Configuration-Specific Information 181
The debugger recognizes using declarations, using directives, namespace aliases, nested
namespaces, and unqualified lookup within a namespace. It also recognizes using di-
rectives and aliases, and using declarations within namespaces.
When the debugger has a list of possible resolutions for a given symbol, it displays a
menu that shows all names fully qualified whenever namespaces are involved. You can
choose the appropriate symbol from the list.
For example, if you stop the debugger in a function that contains an int i using
directive for a namespace such as:
using namespace A::AB::ABC::ABCD
You can use the command print i and if the only possible resolution for i is
A::AB::ABC::ABCD::i the debugger prints out the name of the symbol and its value.
If, however, a global i exists, the debugger displays a menu from which to choose:
(1) i
(2) A::AB::ABC::ABCD::i
>
Setting breakpoints on functions works in the same way.
The debugger also allows semi-qualified names. For example, if you stop in a function
in namespace B, which is nested in namespace A, and namespace A has an int i, you
can use print B::i to display the value of A::B::i.
To disable namespace support, use the command:
(gdb) set namespaces-enabled off
14.21.9 Command for evaluating the address of an expression
The watch_target command takes an expression as an argument, evaluates it to an
address, and watches the target of that address.
For example:
(gdb) watch_target current_frame
This is equivalent to executing:
(gdb) print current_frame $1 = (struct frame_info *) 0x7fdf78 (gdb) watch
*(struct frame_info *) 0x7fdf78
14.22 Viewing Wide Character Strings
HP WDB print command can print wide characters and wide-character strings of the
type wchar_t. The user must use the /W option of the print command to print wide
characters and wide-character strings.
print /W <wide-char-symbol-name>
14.23 Support for output logging
The Visual Interface for HP WDB terminal user interface (TUI) mode supports the
command, log logfile_name, that saves the content of a session to the specified log
file.