Debugging with GDB Manual The GNU Source-Level Debugger (769148-001, March 2014)
NOTE: Starting from HP WDB 6.4 , with the “nudge triggered rtc reporting” feature, you
can now obtain the batch mode reports on Itanium at any point in time during execution of
process. The requirement that the process running in batch mode should exit smoothly to
produce memory reports, is no longer applicable. You can obtain the batch mode reports by
sending a pre-specified signal to the process running under batch mode .
For more information refer the whitepaper Debugging dynamic memory usage errors using
HP WDB.
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
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.
120 HP-UX Configuration-Specific Information