HP gnu source-level debugger 5992-4701 User Manual

Page 177

Advertising
background image

Table 14-1 Memory Debugging Commands in Interactive and Batch Mode

Batch mode

Interactive mode

Command 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

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 mode

set heap-check watch
address

Instruct GDB to stop, whenever a
block at the given address gets
allocated or deallocated.

Not supported in batch mode

set heap-check
null-check <num>

Instructs malloc to return null after
<num>

invocations of malloc.

Not supported in batch mode

set heap-check
null-check-size
<size>

Instructs malloc to return null after
<num>

bytes have been allocated by

malloc

.

Not supported in batch mode

set heap-check
seed-value <num>

Specifies the seed value to be used
for generating random
null-check-count.

14.10 Debugging Memory Problems

177

Advertising