Debugging with GDB Manual HP WDB v6.3 (5900-2180, August 2012)

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.
min_leak_size = <num> (or) set
heap-check min-leak-size <num>
set heap-check
min-leak-size <num>
Specify the minimum size of a block for
stack trace collection. GDB report leaks
of blocks, smaller than this value.
However, no stack trace is provided.
frame_count = <num> (or) set
heap-check frame-count <num>
set heap-check
frame-count <num>
Specify the depth of call stack to be
captured
Not supported in batch modeset heap-check watch
address
Instruct GDB to stop, whenever a block at
the given address gets allocated or
deallocated.
Not supported in batch modeset heap-check
null-check <num>
Instructs malloc to return null after
<num> invocations of malloc.
Not supported in batch modeset heap-check
null-check-size <size>
Instructs malloc to return null after
<num> bytes have been allocated by
malloc.
Not supported in batch modeset heap-check
seed-value <num>
Specifies the seed value to be used for
generating random
null-check-count.
136 HP-UX Configuration-Specific Information