Debugging Dynamic Memory Usage Errors Using HP WDB (5900-1474; WDB 6.2; January 2011)
NOTE: To preload from a path that is different from the default paths, you must use the
LD_PRELOAD environment variable.
Using LD_PRELOAD TO Preload librtc.[sl|so]
To explicitly preload an appropriate version of librtc.[sl|so] with the application,
set the environment variable, LD_PRELOAD as follows:
• For 32-bit applications running on Itanium,
LD_PRELOAD=/opt/langtools/lib/hpux32/librtc.so <executable> <arguments>
• For 64-bit applications running on Itanium,
LD_PRELOAD=/opt/langtools/lib/hpux64/librtc.so <executable> <arguments>
• For 32-bit applications running on PA-RISC,
LD_PRELOAD=/opt/langtools/lib/librtc.sl <executable> <arguments>
• For 64-bit applications running on PA-RISC,
LD_PRELOAD=/opt/langtools/lib/pa20_64/librtc.sl <executable> <arguments>
NOTE: If LD_PRELOAD and chatr +rtc are used to preload the librtc.[sl|so]
runtime library, librtc[sl|so] is loaded from the path specified by LD_PRELOAD.
Overriding the Default Location for librtc.[sl|so]
By default WDB uses the librtc.[sl|so], available at the location
/opt/langtools/lib. If the application requires the use of librtc.[sl|so] at a
different location, you must set the environment variable, LIBRTC_SERVER, to point to
the location where the library is located.
Following is the syntax for setting an alternate location for librtc.[sl|so]:
export LIBRTC_SERVER=<path>
NOTE: This environmental variable is applicable for attach and interactive mode also.
Overriding the Default Path for Searching the GDB Executable
On Itanium systems, from librtc version 6.1, gdb is not invoked in batch mode. Prior
to librtc version 6.1, the GDB_SERVER variable enables you to override the default
path from where the gdb executable is used to debug memory problems. The default
path for the gdb executable is /opt/langtools/bin/gdb.
Following is the syntax to override the default path for the gdb executable:
export GDB_SERVER=<path>
62