HP aC++/HP C A.06.28 Programmer's Guide Integrity servers (769150-001, March 2014)

Please install the HP WDB bundled with the compiler or a more recent version of wdb to get full
functionality.
The default behavior of the +check=malloc option can be changed by users providing their own
rtcconfig file. The user specified rtcconfig file can be in the current directory or in a directory
specified by the GDBRTC_CONFIG environment variable. The default configuration used by the
+check=malloc option is:
check_bounds=1;check_free=1;scramble_block=1;
abort_on_bounds=1;abort_on_bad_free=1;abort_on_nomem=1;
check_leaks=1;min_leak_size=0;check_heap=0;
frame_count=4;output_dir=.;
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:
The thread attempts to acquire a nonrecursive mutex that it currently holds.
The thread attempts to unlock a mutex or a read-write lock that it has not acquired.
The thread waits (blocked) on a mutex or read-write lock that is held by a thread with a different
scheduling policy.
80 Command-Line Options