Debugging with GDB Manual (5900-1473; WDB 6.2; January 2011)

Table Of Contents
14.10.9.7 Specify the amount of guard bytes for every block of allocated memory
HP WDB enables you to programmatically control the size of guard bytes for every block
of the allocated memory. You can use these guard bytes to spot very rare and non-trivial
boundary (buffer over-run and buffer under-run) corruptions. This again is available
optionally when the user specifies set heap-check retain-freed-blocks <on>.
14.10.10 Comparison of Memory Debugging Commands in Interactive Mode and Batch
Mode
HP WDB 5.6 and later versions provide consistency in format for the batch mode options
and the interactive mode commands.
The following table lists the memory debugging commands available in batch and
interactive mode:
Table 2 Memory Debugging Commands in Interactive and Batch Mode
Batch modeInteractive modeCommand Description
check_heap= [on | off] (or)
set heap-check [on | off]
set heap-check [on
| off]
Toggles heap profiling and detection
of leaks, bounds, and double free
check_leaks =[on | off] (or)
set heap-check leaks [on
|off]
set heap-check leaks [on
|off]
Toggle the leak detection capability
check_string= [on |off] (or)
set heap-check string [on |
off]
set heap-check
string [on | off]
Toggle validation of calls to strcpy,
strncpy, memcpy, memccpy,
memset, memmove, bzero, and
bcopy
check_free = [on |off] (or)
set heap-check free [on |
off]
set heap-check free
[on |off]
Toggle validation of calls to free()
scramble_blocks=[on| off] (or)
set heap-check scramble [on
|off]
set heap-check
scramble [on |off]
Specify whether freed blocks should
be scrambled
check_bounds = [on | off]
(or) set heap-check bounds
[on| off]
set heap-check
bounds [on| off]
Toggle bounds check on heap blocks
check_openfd = [on | off]Not SupportedToggle the capability of detection of
open file descriptors
min_heap_size = <num> (or) set
heap-check min-heap-size
<num>
set heap-check
min-heap-size <num>
Specify the minimum size of a block
for stack trace collection. GDB will
report blocks of size greater than or
equal to <num> at each call-site.
14.10 Debugging Memory Problems 171