Debugging Dynamic Memory Usage Errors Using HP WDB (766161-001, March 2014)

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.
ENVIRONMENT VARIABLE The name of an environment variable, for example, PATH.
ERROR NAME The name of an error, usually returned in the errno variable.
Variable The name of a placeholder in a command, function, or other
syntax display that you replace with an actual value.
< > The contents are optional in syntax. If the contents are a list
separated by |, you must choose one of the items.
[ ] The contents are optional in syntax. If the contents are a list
separated by |, you must choose one of the items.
| Separates items in a list of choices.
IMPORTANT This alert provides essential information to explain a concept or
to complete a task
Introduction 5