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

mem_logfile=stderr[+]filename
heap_logfile=stderr[+]filename
Specify config_strings for +check=malloc on Itanium or HP WDB memory check
batch mode on Integrity systems.
Processing of the .gdbinit file is not enabled in batch mode from librtc 6.1 version and
later. On Itanium system for librtc versions prior to 6.1, RTC_PROCESS_GDBINIT is an
optional environment variable used to enable processing of the .gdbinit file. You can use
the .gdbinit file to specify path settings such as dir, objectdir, and pathmap to set the path
of the source and object files in case the source or object paths are different than the current
directory, so that the generated RTC reports display the symbol names and line numbers
correctly. This feature is optionally enabled only when the RTC_PROCESS_GDBINIT
environment variable is set to 1.
There are limitations on what commands in the .gdbinit file. If there are erroneous commands
in the .gdbinit file, the batch RTC session can possibly hang and not produce the expected
RTC reports. Following are some examples:
1. If the 'q' (quit) command is used, the session would hang and finally terminate after
approximately 10 mins, and not generate any RTC reports. It would print the error message
"Broken synchronization between child/parent process".
2. If any gdb command that would take more processing time is used, this would interfere
with the assumptions of RTC and the session may hang and print the error message
"Broken synchronization between child/parent process".
14.10.5.3 Example for Batch Mode RTC
This section illustrates examples of batch mode RTC on HP 9000 and Integrity Systems.
Example for Batch Mode RTC of a PA-RISC 32 bit Executable
1. Compile the source files.
2. The rtcconfig file must contain entries, such as the following:
check_heap=on
check_leaks=on
check_free=on
files=executable_name
output_dir=/tmp/results
3. Set the following environment variables as follows:
export BATCH_RTC=on
14.10 Debugging Memory Problems 129