Debugging threads with HP Wilde Beest
If LD_PRELOAD and chatr +rtc are used to preload the librtc runtime library,
the librtc runtime library is loaded from the path specified by LD_PRELOAD.
3. Complete one of the following steps:
• Attach the debugger to the required process and enable thread debugging,
as follows:
gdb -thread -p <pid>
or
gdb -thread <executable> <pid>
• Alternately, you can attach the process to the debugger and consequently
invoke thread debugging, as follows:
$ gdb <executable> <pid>
...
(gdb)set thread-check on
Thread Debugging in +check Mode
The +check=thread compiler option enables batch mode thread debugging features
of HP WDB.
NOTE: This feature is available only for compiler versions A.06.20 and later.
It is a convenient way of launching the batch mode advanced thread checking features
without setting any other environment variables at runtime. In other words, batch
mode thread checking has two modes of invocation. The first method is to use the run-
time environment variables LD_LIBRARY_PATH, LD_PRELOAD and BATCH_RTC on
existing precompiled applications. The second method is to use the +check=thread
option at the compile time.
+check=thread must only be used with multithreaded programs. It is not enabled
by +check=all. This functionality requires HP WDB 5.9 or later.
The default configuration used by +check=thread option is as follows:
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=.;
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.
If any thread error condition is detected during the application run, the error log will
be output to a file in the current working directory. The output file will have the
following naming convention:
<executable name>.<pid>.threads,
Modes of Thread debugging in HP WDB 43