HP aC++/HP C A.06.20 Programmer's Guide
When +check=bounds:pointer is also turned on, it can check freed memory
read/write. But the check needs to retain freed memory which is not turned on by
default. To turn on the feature, set the following environment variable at runtime:
RTC_MALLOC_CONFIG="retain_freed_blocks=1"
Or add "retain_freed_blocks=1" to the rtcconfig file. When malloc failes to allocate
specified memory, the runtime system will free the retained freed memory and try to
allocate memory.
For a description for the above configuration parameters and the full list of other
parameters, please refer to the HP WDB debugger documentation.
+check=stack[:frame|:variables|:none]
The +check=stack[:frame|:variables|:none] option enables runtime checks
to detect writes outside stack boundaries. Markers are placed before and after the whole
stack frame and around some stack variables. On procedure exit, a check is done to see
if any marker has been overwritten. If any stack check fails, an error message and stack
trace is written to stderr and the program is aborted. The stack checks are not
performed for an abnormal exit from the procedure (for example, using longjmp,
exit, abort, or exception handling).
+check=stack:frame
This option enables runtime checks for illegal writes from the current stack frame that
overflow into the previous stack frame.
+check=stack:variables
This option enables runtime checks for illegal writes to the stack just before or after
some variables on the stack. This includes array, struct/class/union, and variables
whose address is taken. It also includes the overflow check for the stack frame
(+check=stack:frame). In addition to the above checks, this option causes the whole
stack to be initialized to a "poison" value, which can help detect the use of uninitialized
variables on the stack.
+check=stack:none
This option disables all runtime checks for the stack.
+check=stack
The +check=stackoption without any qualifiers is equivalent to
+check=stack:variables at optimization levels 0 and 1. It is equivalent to
+check=stack:frame for optimization level 2 and above.
+check=thread
The +check=thread option enables the batch-mode thread-debugging features of
HP WDB 5.9 or later, and can detect the following thread-related conditions:
106 Command-Line Options