Debugging with GDB Manual HP WDB v6.3 (5900-2180, August 2012)

5. Complete one of the following steps to preload the librtc runtime library:
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 enable or disable the target application to preload the librtc runtime library, enter
the following command at the HP-UX prompt:
$ chatr +rtc <enable|disable> <executable>
NOTE: The chatr +rtc option preloads the librtc runtime library from the following
default paths:
For 32 bit IPF applications,
/opt/langtools/lib/hpux32/librtc.so
For 64 bit IPF applications,
/opt/langtools/lib/hpux64/librtc.so
For 64-bit PA applications,
/opt/langtools/lib/pa20_64/librtc.sl
To preload the librtc runtime library from a path that is different from the default paths,
you must use the LD_PRELOAD environment variable.
OR
Instead of automatically preloading librtc and mapping the shared libraries, you can
explicitly preload the required librtc library after mapping the shared libraries private.
In the case of HP 9000 systems, you must explicitly map the share libraries as private by
using the +dbg enable option for the chatr command, as follows:
$ chatr +dbg enable ./<executable>
(This step is not required on Integrity systems.)
To explicitly preload the librtc runtime library and start the target application, enter one
of the following commands:
For 32 bit IPF applications,
LD_PRELOAD=/opt/langtools/lib/hpux32/librtc.so <executable>
For 64 bit IPF applications,
LD_PRELOAD=/opt/langtools/lib/hpux64/librtc.so <executable>
For 64-bit PA applications,
LD_PRELOAD=/opt/langtools/lib/pa20_64/librtc.sl <executable>
If LD_PRELOAD and chatr +rtc are used to preload the librtc runtime library , the
librtc runtime library is loaded from the path specified by LD_PRELOAD.
If HP WDB detects any thread error condition during the application run, the error log is output
to a file in the current working directory. The output file has the following naming convention:
<executable name>.<pid>.threads
where,
<pid> is the process id.
148 HP-UX Configuration-Specific Information