Debugging Dynamic Memory Usage Errors Using HP WDB (766161-001, March 2014)

Table 16 Commonly Used Commands for Memory Debugging (continued)
Batch ModeInteractive Mode/Attach ModeDescription
set heap-check free <on/off>set heap-check free <on/off>Enables you to detect double-frees and
frees with improper arguments
set heap-check scramble
<on/off>
set heap-check scramble
<on/off>
Enables you to scramble blocks.
set heap-check bounds
<on/off>
set heap-check bounds
<on/off>
Enables you to check for out-of-bounds
corruption when the block is freed.
set heap-check string
<on/off>
set heap-check string
<on/off>
Enables validation of calls to
strcpy(), strncpy(), memcpy(),
memccpy(),memset(), memmove(),
bzero(), and, bcopy()
set heap-check frame-count
<num>
set heap-check frame-count
<num>
Enables you to set the number of
frames to be printed for leak and heap
profiles.
set heap-check min-heap-size
<num>
set heap-check min-heap-size
<num>
Enables you to set the minimum block
size to report in heap profiles.
set heap-check min-leak-size
<num>
set heap-check min-leak-size
<num>
Enables you to set the minimum block
size to use for leak detection.
Not supported in Batch Modeset heap-check watch addressStops program execution when the
block at the given address is allocated
or de-allocated
Not supported in Batch Modeinfo corruptionChecks for corruption in the currently
allocated heap blocks and optionally
lists the in-block corruptions in the
freed blocks.
Not supported in Batch Modeinfo danglingDisplays a list of all the dangling
pointers and dangling blocks that are
potential sources of memory
corruption.
Not supported in Batch Modeset heap-check null-check
<num>
Forces malloc() to return NULL after
<N> invocations of malloc()
Not supported in Batch Modeset heap-check
null-check-size <size>
Forces malloc() to return NULL after
<N> bytes are allocated by the
program
Not supported in Batch Modecatch nomemEnables the user to gain control over
an out-of-memory event. The user can
step through program execution after
the nomem event is detected.
Not supported in Batch Modeset heap-check seed-value
<num>
Defines the seed-value for random
number calculation for the set
heap-check null-check random
command
Not supported in Batch Modeset heap-check random-range
<num>
Forces malloc() to return NULL after
random number of invocations of
malloc()
Not supported in Batch Modeset heap-check resetThis command resets the data existing
in the file for incremental profiling and
creates a new data file. The old data
in the file is erased.
Not supported in Batch Modeset heap-check interval
<num>
Starts the incremental heap growth
profile. All allocations prior to the
execution of this command are
Summary of Memory Debugging Commands 67