Debugging Dynamic Memory Usage Errors Using HP WDB (5900-1474; WDB 6.2; January 2011)

Debugging in Batch Mode
To debug an application in the batch mode, complete the following steps:
1. Compile the source files.
NOTE: On HP 9000 systems, you must map the shared libraries as private, by
using the chatr command if you are using LD_PRELOAD to preload the
librtc.[sl|so] instead of the +rtc <enable|disable> option for the chatr
command .
chatr +dbg enable ./<executable>
On HP-UX 11i v3 Integrity systems, WDB enables automatic debugging of shared
libraries without them being mapped private while attaching to a running program.
For enabling automatic debugging of shared libraries, you must install the kernel
patches PHKL_38651 and PHKL_38778.
2. Set the required variables in the rtcconfig configuration file, as follows:
$ cat rtcconfig
"rtcconfig" 5 lines, 76 characters
set heap-check on
set heap-check free on
files=executable_name
output_dir= ./
3. Set the required environment variables as follows:
export BATCH_RTC=on
Supported Modes of Memory-debugging in WDB 67