Debugging with GDB Manual The GNU Source-Level Debugger (769148-001, March 2014)
Instruction Level Stepping
During instruction level stepping with nexti and stepi, HP WDB prints the assembly instruction along
with the next source line.
(gdb) stepi 0x101530:0 st4 [r9]=r34 1337 args.argc = argc;
It also prints DOC line information, which includes actual line number and the column number,
when debugging a binary with -g -O.
(gdb) stepi ;;; [8, 1] 0x4000820:1 nop.m 0x0
GDB cannot step into a function with no debug information. GDB cannot do a next over a line
when there is not debug information. However, the continue command works in such situations.
Enhanced support for watchpoints and breakpoints
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.
Hardware watchpoints
HP WDB provides support for hardware watchpoints on HP-UX 11.x. through the following
commands.
• set can-use-hw-watchpoints integer
Set debugger's willingness to use hardware watchpoint. If the integer value is set to zero,
then gdb does not use hardware for new watchpoints, even if the hardware watchpoints are
available. However, if there are hardware watchpoints created before setting this to nonzero,
the debugger will continue to use the hardware watchpoints.
• show can-use-hw-watchpoints
Displays if the debugger currently can use hardware watchpoint or not.
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 HP WDB cannot set a
normal breakpoint in the shared library.
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.
158 HP-UX Configuration-Specific Information