Debugging with GDB (September 2007)

Chapter 14: HP-UX Configuration-Specific Information 143
librtc library, the +mem_check 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 +mem_check enable <executable>
Example for Batch Mode RTC on Integrity Systems: Example-1
Step 1: Compile the source files.
Step 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
Step 3: Set the following environment variables as follows:
export BATCH_RTC=on
Step 4: Complete one of the following steps:
- Preload the librtc runtime library, as follows: LD_
PRELOAD=/opt/langtools/lib/hpux32/librtc.so <executable>
<arguments if any>
(Or)
- Preload the librtc runtime library, as follows: $ chatr +mem_check
enable <executable>
Example from Integrity Systems: Example-2
Step 1: Compile the source files.
Step 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
Step 3: Set the following environment variables as follows:
export BATCH_RTC=on
Step 4: Complete one of the following steps:
- Use the +mem_check option for the chatr command on each of the re-
quired executable files that must b e instrumented, as follows:
$ chatr +mem_check enable exec1 exec2 exec3
(Or)
- Preload the librtc library as follows:
export LD_PRELOAD /opt/langtools/lib/hpux32/librtc.so