Debugging with GDB Manual The GNU Source-Level Debugger (769148-001, March 2014)
4. Complete one of the following steps:
– Map the shared libraries privately using chatr, as follows:
chatr +dbg enable <executable>
On HP-UX 11i v3 Integrity systems, HP WDB enables automatic debugging of shared
libraries without them being mapped private while attaching to a running program.
For enabling automatic debugging of shared libraries, you must install the kernel
patches PHKL_38651 and PHKL_38778.
Explicitly preload the librtc runtime library and start the target application, as
follows:
LD_PRELOAD=/opt/langtools/lib//librtc.sl <executable>
<arguments>
OR
– Set the target application to preload librtc by using the +rtc option for the chatr
command. In addition to automatically loading the librtc library, the +rtc option
for the chatr command also maps the shared libraries as private.
To set the target application to preload the librtc runtime library, enter the following
command at the HP-UX prompt:
$ chatr +rtc enable <executable>
– Run the program as follows:
./<executable name>
• Example for Batch Mode RTC on Integrity Systems: Example-1
1. Compile the source files.
2. The rtcconfig file must contain entries such as the following:
check_heap=on
check_leaks=on
check_free=on
files=executable_name
output_dir=/tmp/results
3. Set the following environment variables as follows:
export BATCH_RTC=on
4. Complete one of the following steps:
– Preload the librtc runtime library, as follows:
PRELOAD=/opt/langtools/lib/hpux32/librtc.so <executable>
<arguments if any>
OR
– Preload the librtc runtime library, as follows:
$ chatr +rtc enable <executable>
5. Run the program as follows:
./<executable name>
• Example from Integrity Systems: Example-2
1. Compile the source files.
2. The rtcconfig file should contain entries such as the following:
check_heap=on
check_leaks=on
check_free=on
files=exec1:exec2:exec3
output_dir=/tmp/results
122 HP-UX Configuration-Specific Information