Download HP gnu source-level debugger 5992-4701 User's Manual

Transcript
Table 14-1 Memory Debugging Commands in Interactive and Batch Mode
Command Description
Interactive mode
Batch mode
Toggles heap profiling and detection set heap-check [on
of leaks, bounds, and double free
| off]
check_heap= [on | off] (or)
set heap-check [on | off]
Toggle the leak detection capability set heap-check leaks [on
|off]
check_leaks =[on | off] (or)
set heap-check leaks [on
|off]
Toggle validation of calls to strcpy, set heap-check
strncpy, memcpy, memccpy,
string [on | off]
memset, memmove, bzero, and
bcopy
check_string= [on |off] (or)
set heap-check string [on |
off]
Toggle validation of calls to free() set heap-check free
[on |off]
check_free = [on |off] (or)
set heap-check free [on |
off]
Specify whether freed blocks should set heap-check
be scrambled
scramble [on |off]
scramble_blocks=[on| off] (or)
set heap-check scramble [on
|off]
Toggle bounds check on heap blocks set heap-check
bounds [on| off]
check_bounds = [on | off]
(or) set heap-check bounds
[on| off]
Specify the minimum size of a block set heap-check
for stack trace collection. GDB will min-heap-size <num>
report blocks of size greater than or
equal to <num> at each call-site.
min_heap_size = <num> (or) set
heap-check min-heap-size
<num>
Specify the minimum size of a block set heap-check
for stack trace collection. GDB report min-leak-size <num>
leaks of blocks, smaller than this
value. However, no stack trace is
provided.
min_leak_size = <num> (or) set
heap-check min-leak-size
<num>
Specify the depth of call stack to be
captured
set heap-check
frame-count <num>
frame_count = <num> (or) set
heap-check frame-count <num>
Instruct GDB to stop, whenever a
block at the given address gets
allocated or deallocated.
set heap-check watch Not supported in batch mode
address
Instructs malloc to return null after set heap-check
<num> invocations of malloc.
null-check <num>
Not supported in batch mode
Instructs malloc to return null after set heap-check
<num> bytes have been allocated by null-check-size
malloc.
<size>
Not supported in batch mode
Specifies the seed value to be used
for generating random
null-check-count.
Not supported in batch mode
set heap-check
seed-value <num>
14.10 Debugging Memory Problems
177