Debugging Dynamic Memory Usage Errors Using HP WDB (5900-1474; WDB 6.2; January 2011)
WDB provides the interactive, batch, and attach modes for debugging memory-related
problems. See “Supported Modes of Memory-debugging in WDB” (page 59) for more
information on the supported modes for debugging.
HP aC++/ HP C Compiler Runtime Checking Options
The HP aC++/HP C compiler also provides options for enabling memory debugging
using WDB in Integrity Systems. This feature is supported only on Integrity Systems.
Table 2 list the runtime checking options are available in HP aC++/HP C compilers for
memory debugging.
Table 2 Compiler Options for Memory Debugging
DescriptionCompiler Option
The +check compiler options provide runtime checks
to detect out-of-bounds array references
(+check=bounds), memory leaks and heap
corruption (+check=malloc), writing outside the
stack frame(+check=stack), and uninitialized
variables (+check=uninit). The +check=all
option enables all the available runtime checks for
the +check compiler option.
A failed check results in the program abort at
runtime. The error message and the stack trace is
printed to stderr before the program terminates.
The environment variable RTC_NO_ABORT must be
set to 1 to continue the program execution after a
failed runtime check. This enables you to collect the
diagnostics for all the failed checks in a single
execution run.
+check=
[all|none|bounds|malloc|stack|uninit]
NOTE: The +check options must be specified at compile time and link time. If different
+check options are specified while compiling different source files, all the specified
+check options are needed at link time. Multiple +check options are interpreted from
left to right with the options on the right overriding earlier +check options.
For more information on the HP aC++ compiler options for memory debugging, see the
HP aC++ World Wide Webpage at:
http://www.hp.com/go/cpp
For more information on the HP aC++ compiler options for memory debugging, see the
HP C World Wide Webpage at:
http://www.hp.com/go/c
Using WDB to Debug Memory Problems 11