Debugging with GDB Manual (5900-1473; WDB 6.2; January 2011)

Table Of Contents
To avoid changing of the run-time binding behavior of a program to BIND_IMMEDIATE,
to perform command line call, do the following:
Use the linker option, +ea, to export symbols from an object file.
Install the linker patch, PHSS 28870 (for 11.0) or PHSS 28871 (for 11i).
Execute the following commands:
cc -c file.c cc file.o -Wl,+ea,/opt/langtools/lib/end.o -s
14.36.2.2 For 64-bit applications
To perform command line calls in a stripped executable, linked with end.o, you need
to do the following:
In the +std link mode, GDB supports this feature without any changes. You must
export the __wdb_call_dummy symbol as shown in the next line.
In the +compat link mode, execute the following command:
cc +DD64-g file.c -Wl,+ee,__wdb_call_dummy -s
14.36.3 Support for debugging stripped binaries
HP WDB provides limited support for debugging stripped binaries.
14.36.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 locals defined in other unstripped shared
libraries loaded into the stripped executable when you are in the right scope.
14.36.3.2 Backtrace on stripped frames
GDB should be able to backtrace properly 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.36.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.36.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 numbers in the stripped modules.
242 HP-UX Configuration-Specific Information