Debugging with GDB Manual The GNU Source-Level Debugger (769148-001, March 2014)
Support for procedural breakpoints
HP WDB enables you to set breakpoints at the beginning (first executable line) of every function
that can be debugged. In addition, you can specify a set of commands to be performed when the
breakpoint is reached. These breakpoints work like procedural breakpoints in the xdb debugger.
The breakpoint commands are rbp and rdp.
• rbp
Sets breakpoints at the first executable statement in all the functions that can be debugged,
including any shared libraries that are already loaded. The rbp command sets breakpoints
in all the functions, which can be debugged, in all the source files. After you set these
breakpoints, you can manage them like any standard breakpoints. You can delete them,
disable them, or make them conditional. Each time you use the rbp command, HP WDB adds
an additional breakpoint at the beginning of each function that performs the commands you
specify, if any.
• rdp
Deletes all the breakpoints set by the rbp command.
This example shows how to set a breakpoint at the start of each procedure that displays information
at the breakpoint:
(gdb) file a.out
Reading symbols from a.out...done.
(gdb) rbp
Breakpoints set from 170 to 211
Type commands to execute when the breakpoint is hit (one command per line).
End with a line saying just "end".
>info break
>end
(gdb)
Support for template breakpoints
With HP WDB 5.0, you can set breakpoints on all instantiations of the template class by just
specifying the template name with member function name.
For example:
(gdb) break ::
It is not necessary to specify the instantiation type.
Setting a breakpoint on a template method with multiple instantiations displays a menu showing
all instantiations and the user can choose to set breakpoints on all or any one or none.
For example,
(gdb) file test
Reading symbols from test...done.
(gdb) b MyClass::MyMember
[0] cancel
[1] all
[2] MyClass::MyMember(int, int) at test.C:14
[3] MyClass::MyMember(int, float) at test.C:14
[4] MyClass::MyMember(int, double) at test.C:14
Debugging support for shared libraries
On HP-UX, shared libraries are special. Until the library is loaded, GDB does not know the names
of symbols. However, GDB gives you two ways to set breakpoints in shared libraries:
• deferred breakpoints
• catch load command
Debugging support for shared libraries 159