Debugging with GDB (February 2008)

Table Of Contents
Chapter 14: HP-UX Configuration-Specific Information 195
14.30.1 Support for command line calls in a stripped
executable on PA-RISC systems
In WDB, to perform command line calls in a shared library without the help of dynamic
linker (using end.o), you must execute the following command:
chatr -B immediate <executable>
In addition, modify all the calls to shl_load() to specify BIND_IMMEDIATE.
To perform command line calls after attaching a running process to GDB, you must
execute one of the following commands:
/opt/langtools/bin/pxdb -s on <executable>
chatr +dbg enable <executable>
14.30.2 Additional support for command line calls in a
stripped executable
HP WDB enables you to perform command line calls in a stripped executable. The
various scenarios in which you can make command line calls in a stripped executable
are as follows:
14.30.2.1 For 32-bit applications:
To perform command line calls in a shared library, without the help of dynamic linker
(using end.o), you must perform the following operations:
Execute the chatr -B immediate <executable> command.
Modify all the calls to shl_load() to specify BIND_IMMEDIATE, if any.
To perform command line calls after attaching GDB to a running process, without the
help of dynamic linker (using end.o), you must do the following for the program:
Execute the chatr -B immediate <executable> command
Modify all the calls to shl_load() to specify BIND_IMMEDIATE, if any.
Execute the /opt/langtools/bin/pxdb -s on <executable> or chatr +dbg
enable <executable> command.
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.30.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: