Debugging Dynamic Memory Usage Errors Using HP WDB

Table 13 Supported Variables in the Batch Mode Configuration File (continued)
DescriptionCommand
Enables validation of calls to strcpy(), strncpy(),
memcpy(), memccpy(),memset(), memmove(),
bzero(), and, bcopy()
set heap-check string <on/off>
Enables you to check for out-of-bounds corruption when
the block is freed
set heap-check bounds <on/off>
Enables you to specify the executables for which memory
leak detection is enabled. If the files option is not specified
(after setting BATCH_RTC=on) , the debugger checks all
the executables.
files=<file1:file2:..fileN>
Enables you to set the number of frames to be collected
for leak or heap profiles
set heap-check frame-count <num>
Enables you to set the minimum block size to use for heap
reporting
set heap-check min-heap-size <num>
Enables you to set the minimum block size to use for leak
reporting
set heap-check min-block-size <num>
Enables you to specify the name of the output data
directory
output_dir= <output_data_dir_path>
Enables you to scramble the blocks
set heap-check scramble <on/off>
Overriding the Configuration File Settings
The RTC_MALLOC_CONFIG variable enables you to override the default rtcconfig file settings.
Following is the syntax for exporting the configuration to RTC_MALLOC_CONFIG:
export RTC_MALLOC_CONFIG=config_string1[;config_strings]
The overriding settings of RTC_MALLOC_CONFIG are dependent on the global environment
variable RTC_NO_ABORT setting. RTC_NO_ABORT must not be set if the configuration strings
must abort the execution of the program on detection of the first occurrence of bounds, double-free,
or out-of-memory conditions.
If RTC_NO_ABORT is set to 1, the program does not abort for failed checks and you can view the
logfiles for all the failed checks in a single execution run.
Table 14 lists the config_strings options that are available for RTC_MALLOC_CONFIG. The
config_strings are separated by semicolon (;).
Table 14 The config_strings Options for RTC_MALLOC_CONFIG
Descriptionconfig_string Options
RTC_NO_ABORT must not be set.
If abort_on_bounds is set to 1, the batch mode aborts
execution of the program and reports the bounds
condition, when bound checking fails.
abort_on_bounds=[01]
RTC_NO_ABORT must not be set.
If abort_on_bad_free is set to 1, the batch mode aborts
execution when a free(), or a realloc() call attempts
to free a heap object that is not valid.
abort_on_bad_free=[01]
58