Debugging with GDB (February 2008)

Table Of Contents
Chapter 14: HP-UX Configuration-Specific Information 173
14.19.1 Deferred watchpoints
When you try to set a watchpoint in an expression, HP WDB places a deferred watch-
point if HP WDB cannot evaluate the expression. The watchpoint is automatically
enabled whenever the expression can be evaluated during the programs execution.
This is especially useful when placing the watchpoints on unallocated addresses.
14.19.2 Hardware watchpoints
HP WDB provides support for hardware watchpoints on HP-UX 11.x.
14.19.3 Hardware breakpoints
The hbreak command sets hardware assisted breakpoints.
hbreak args
The arguments (args) is same as that for the break command and the breakpoint is set
in the same way. However, the breakpoint uses hardware assisted breakpoint registers.
There are only two hardware breakpoints that can be set on Integrity systems. This
is useful in ROM code debugging and shared library debugging for libraries, including
dld, that are not loaded private.
The normal breakpoints are converted to a hardware breakpoint when WDB cannot
set a normal breakpoint in the shared library.
14.19.3.1 Setting breakpoints in unstripped shared library
GDB will not be able to put breakpoints using symbolic names(of the symbols not in
export list) or line numbers in the stripped modules.
GDB will be able to place breakpoints using symbol names in the unstripped shared
libraries loaded into the stripped executable.
14.19.4 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.