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

NOTE: During operations such as system(3s) and popen(), which invoke a new shell,
librtc.sl|so must not be loaded to the invoked shell. You must use LD_PRELOAD_ONCE,
instead of LD_PRELOAD, to exclusively load the librtc.sl|so file to the calling process
only. Following is the syntax for using LD_PRELOAD_ONCE:
LD_PRELOAD_ONCE= /opt/langtools/lib/librtc.sl
14.10.5.2 Environment variable setting for Batch mode debugging
Batch mode memory leak detection uses the following environment variables:
GDBRTC_CONFIG specifies the location of rtc configuration file. If this option is not specified,
the configuration file is assumed to be in the current location, and has the filename rtcconfig.
If user prefers to set this option, it must include the filename.
Incorrect usage:
export GDBRTC_CONFIG=./
export GDBRTC_CONFIG=/tmp
Correct usage:
export GDBRTC_CONFIG=/tmp/yet_another_config
export GDBRTC_CONFIG=/tmp/rtcconfig
BATCH_RTC enables or disables batch memory leak detection.
On Itanium systems, from librtc version 6.1, gdb is not invoked in batch mode. Prior to
librtc version 6.1, the GDB_SERVER is used to override the default path from where the gdb
executable is used to provide the information on memory leak. By default, /opt/langtools/
bin/gdb is used to print the output. This can be overridden by setting GDB_SERVER
appropriately.
RTC_MALLOC_CONFIG is used to override the default config and rtcconfig file settings.
This variable can be set as follows:
export RTC_MALLOC_CONFIG=config_string1[;config_strings].
The config_strings are separated by a semi-colon(;).
The following config_strings options exist for RTC_MALLOC_CONFIG:
Aborts execution when heap objects bounds check
fail, value is 1, and the environment variable
RTC_NO_ABORT is not set.
abort_on_bounds=[01]
abort_on_bad_free=[01] Aborts execution when free or realloc is trying to
free a heap object which is not valid, value is 1,
and environment variable RTC_NO_ABORT is not
set.
abort_on_nomem=[01] Aborts execution when out of memory if value is
1, and environment variable RTC_NO_ABORT is
not set.
leak_logfile=stderr[+]filename The log file for batch mode must be specified.
stderr: error message goes to stderr
[+]filename: error message goes to filename, +
means output is appended to the file.
128 HP-UX Configuration-Specific Information