Debugging with GDB (September 2007)
Chapter 14: HP-UX Configuration-Specific Information 193
14.30.3 Support for debugging stripped binaries
HP WDB provides limited supp ort for debugging stripped binaries.
14.30.3.1 Printing of locals and globals in a stripped module
GDB will not be able to print the locals and statics declared in a module which has
been stripped. GDB will be able to print the exported symbols since exported symbols
are not stripped with strip command (they stay in .dynsym).
GDB will be able to access the globals or loc als defined in other unstripped shared
libraries loaded into the stripped executable when you are in the right scope.
14.30.3.2 Backtrace on stripped frames
GDB should be able to backtrace prop erly stripped frames. Arguments will not be
displayed (as in the case of non -g binary). If it is a fully archived stripped binary,
function names will not be displayed (but PCs will be).
14.30.3.3 Command line calls to non-stripped library
Command line calls to the functions (exported symbols) in the stripped binary work
fine. Command line calls to the non-stripped library work normally regardless where
the process is stopped.
14.30.3.4 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 numb ers in the stripped modules.
GDB w ill be able to place breakpoints using symbol names in the unstripped shared
libraries loaded into the stripped executable.
14.31 Displaying the current block scope information
The which command takes a symbol as an argument and prints the information on a
given symbol. It prints the following information:
• current block scope addresses
• line information of the definition of the symbol
• filename in which the definition of the symbol occurs
The which command does not work for global and type symbols since they do not
contain line information.
Syntax:
which <symbol>
For example : (gdb) which i Line 4 of "example.c" block starts at address
0x29a8 <main> and ends at 0x29e4 <main+0x3c>