Debugging with GDB Manual The GNU Source-Level Debugger (769148-001, March 2014)
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.
Not supported in batch modeset heap-check
random-range <num>
Specifies the random range to be used by
random-range.
Not supported in batch modeset heap-check
interval <num>
Specifies the time interval to be used for
incremental memory profile.
Not supported in batch modeset heap-check repeat
<num>
Perform incremental profile for <num>
interval periods where each period
duration is defined by set heap-check
interval command. The default value is
100.
130 HP-UX Configuration-Specific Information