Debugging with GDB (September 2007)
142 Debugging with GDB
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 m emory if value is 1, and environ-
ment variable RTC_NO_ABORT is not set.
leak_logfile=stderr[+]filename
The log file for batch mode must b e specified.
stderr: error me ss age goes to stderr
[+]filename: error message goes to filename, + means output is
appended to the file.
mem_logfile=stderr[+]filename
heap_logfile=stderr[+]filename
• Specify config_strings for +check=malloc on Itanium or WDB memory
check batch mode on Integrity systems.
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
Step 1: Compile the source files.
Step 2: The rtcconfig file must entries, such as the following:
check_heap=on
check_leaks=on
check_free=on
files=executable_name
output_dir=/tmp/results
Step 3: Set the following environment variables as follows:
export BATCH_RTC=on
Step 4: Complete one of the following steps:
- Map the shared libraries privately using chatr, as follows:
chatr +dbg enable <executable>
Explicitly preload the librtc runtime library and start the target applica-
tion, as follows:
LD_PRELOAD=/opt/langtools/lib//librtc.sl <executable>
<arguments>
(Or)
- Set the target application to preload librtc by using the +mem_check
option for the chatr command. In addition to automatically loading the