Debugging Dynamic Memory Usage Errors Using HP WDB (5900-1474; WDB 6.2; January 2011)
Introduction
HP Wildebeest Debugger (WDB) is an HP-supported implementation of the open source
debugger GDB. Apart from the normal debugging functions, it also enables you to debug
memory-related errors in a program.
HP WDB supports memory-debugging (using Run Time Checking (RTC)) of source-level
programs written in HP C, HP aC++, and Fortran 90 on Itanium®-based systems running
HP-UX 11i v2, or HP-UX 11i v3, and PA-RISC systems running HP-UX 11.0, HP-UX 11i
v1, HP-UX 11i v2, or HP-UX 11i v3 operating systems.
WDB offers the following memory-debugging capabilities:
• Reports memory leaks
• Reports heap allocation profile
• Stops program execution if bad writes occur with string operations such as
strcpy(), and memcpy()
• Stops program execution when freeing unallocated or deallocated blocks
• Stops program execution when freeing a block if bad writes occur outside block
boundary
• Stops program execution conditionally based on whether a specified block address
is allocated or de-allocated
• Scrambles previous memory contents at malloc(), and free() calls
• Simulates and detects out-of-memory event errors
• Monitors changes in data segment space allocation
Intended Audience
This document is intended for C, C++, and Fortran programmers who use WDB to detect
and debug memory-related errors in HP C, HP aC++ and Fortran 90 applications. Reader
of this document must be familiar with the basic commands supported by WDB.
Typographic Conventions
This document uses the following typographical conventions:
$, $ or # A dollar sign represents the system prompt for the
Bourne, Korn, and POSIX shells. A number sign
represents the superuser prompt.
gdb(5) A manpage. The manpage name is gdb.
Command A command name or qualified command phrase.
Computer output Text displayed by the computer.
Introduction 5