Debugging Dynamic Memory Usage Errors Using HP WDB v6.3 (5900-2181, August 2012)
Configuration File for Batch Mode Debugging
You can set your preferences for batch mode memory-debugging by setting the parameters in the
configuration file. The following sections discuss the location of the configuration file and the
supported variables.
Location of the Configuration File for Batch Mode Debugging
The configuration file rtcconfig for batch mode debugging is user-defined. You can specify the
location of the configuration file by exporting the environment variable GDBRTC_CONFIG to contain
the pathname of the configuration file (including the filename).
The following example illustrates how to specify the path of the configuration file:
$ export GDBRTC_CONFIG=/tmp/rtcconfig
From HP WDB Version 6.3 and later, if the path to the configuration file is not specified, the
librtc library searches for the rtcconfig configuration file at the following locations in the
following orders:
1. Current working directory.
2. Home directory of the user if the environment variable $HOME is set.
3. Default rtcconfig configuration file provided under /opt/langtools/wdb/ (Installed
along with HP WDB Version 6.3 and later.)
Supported Variables for Memory-Debugging in the Batch Mode Configuration File
You must specify the variables in the configuration file based on the commands that are required
to debug the application. Table 14 lists the variables that are supported in the configuration file.
Table 14 Supported Variables in the Batch Mode Configuration File
DescriptionCommand
Enables you to detect double-frees and frees with improper
arguments
set heap-check free <on/off>
Enables heap profilingset heap-check <on/off>
Enables you to detect leaksset heap-check leaks <on/off>
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
files=<file1:file2:..fileN>
(after setting BATCH_RTC=on) , the debugger checks all
the executables.
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 directoryoutput_dir= <output_data_dir_path>
Enables you to scramble the blocksset heap-check scramble <on/off>
52