HP C/aC++ for PA-RISC Software manual Executable name.pid.threads

Page 12

+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=stack option 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

This option enables the batch-mode thread-debugging features of HP WDB 5.9 or later. The following thread- related conditions can be detected with +check=thread:

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.

Different threads non-concurrently wait on the same condition variable, but with different associated mutexes.

The threads terminate execution without unlocking the associated mutexes or read-write locks.

The thread waits on a condition variable for which the associated mutex is not locked.

The thread terminates execution, and the resources associated with the terminated thread continue to exist in the application because the thread has not been joined or detached.

The thread uses more than the specified percentage of the stack allocated to the thread.

This option should only be used with multithreaded programs. It is not enabled by +check=all.

Behavior of the +check=thread option can be changed by users by 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=thread option is:

thread-check=1;recursive-relock=1;unlock-not-own=1; mix-sched-policy=1;cv-multiple-mxs=1;cv-wait-no-mx=1; thread-exit-own-mutex=1;thread-exit-no-join-detach=1;stack-

util=80;

num-waiters=0;frame_count=4;output_dir=.;

If any thread error condition is detected during the application run, the error log is output to a file in the current working directory. The output file will have the following naming convention:

<executable name>.<pid>.threads

Where <pid> is the process id.

For further details, see the HP WDB manual.

+check=truncate[:explicit:implicit]

The +check=truncate[:explicit:implicit] option enables runtime checks to detect data loss in assignment when integral values are truncated. Data loss occurs if the truncated bits are not all the same as the left most non-truncated bit for signed type or not all zero for unsigned type.

12

Image 12
Contents Page Compile Time Diagnostics IntroductionWhat’s New Example Page Security Diagnostics Example of unsafe loop exit condition Customization of Compiler Diagnostics Runtime Checking +Olit=none option Page Page Executable name.pid.threads Ch = intval & 0xff Execution Path Recovery Further information
Related manuals
Manual 230 pages 50.97 Kb