Debugging Dynamic Memory Usage Errors Using HP WDB (5900-1474; WDB 6.2; January 2011)

Supported Modes of Memory-debugging in WDB......................................................59
Debugging in the Interactive Mode......................................................................59
Debugging in Batch Mode..................................................................................60
Environment Variables for Batch Memory-Debugging ........................................60
Enabling and Disabling Batch Mode Memory-Debugging ............................60
Pre-loading the Appropriate Version of librtc.[sl|so] Along With the
Application.............................................................................................61
Overriding the Default Location for librtc.[sl|so]...........................................62
Overriding the Default Path for Searching the GDB Executable.......................62
Enabling the Processing of the .gdbinit File..................................................63
Configuration File for Batch Mode Debugging..................................................63
Location of the Configuration File for Batch Mode Debugging........................63
Supported Variables for Memory-Debugging in the Batch Mode Configuration
File.........................................................................................................64
Overriding the Configuration File Settings.........................................................65
Printing Hexadecimal Address of Functions in Allocating Stack Traces Produced in
Batch Mode Heap or Leak Report...................................................................66
Debugging in Batch Mode.............................................................................67
Debugging Multiple Applications in Batch Mode .............................................72
Debugging in Attach Mode.................................................................................73
Summary of Memory Debugging Commands.............................................................75
Debugging Memory Using WDB GUI.......................................................................78
Using WDB GUI to Debug Memory-Related Problems.............................................78
Heap and Leak Profiling Using WDB GUI.............................................................79
Incremental Heap Profiling Using WDB GUI.....................................................79
Arena Profiling Using WDB GUI..........................................................................84
Step by Step Approach for Detecting Leaks................................................................89
Steps to Detect Point of Memory Leak...................................................................89
Sample Test Case to Detect Point of Memory Leak..................................................89
Conclusion............................................................................................................95
Additional Examples...............................................................................................96
FAQ...................................................................................................................105
4 Contents