Debugging threads with HP Wilde Beest

Advanced thread-debugging requires the pthread tracing library. The pthread
tracer library is available by default in systems running on HP-UX 11i v2 or later.
HP WDB 5.5 and later versions support enhanced thread debugging. The
installation scripts for HP WDB 5.5 and later versions of the debugger automatically
add links at /opt/langtools/lib/ to replace the standard libpthread library
with libpthread tracer library at run time.
HP WDB uses librtc.sl to enable thread debugging support. If the debugger
is available in a directory other than the default /opt/langtools/bin directory,
use the environment variable, LIBRTC_SERVER, to export the path of the
appropriate version of librtc.sl.
For PA-RISC 32 bit applications, enable the dynamic path look-up for advanced
thread debugging.
The chatr +rtc feature requires linker version B.11.66 and later on HP 9000
systems, and linker version B.12.51 and later on Integrity systems.
NOTE: To enable dynamic library path look-up for advanced thread debugging, enter
the following command at HP-UX prompt:
# chatr +s enable <PA32-bitApp>
This command automatically enables dynamic library path look-up.
Modes of Thread debugging in HP WDB
HP WDB offers three modes of Thread debugging:
Interactive Mode
Batch Mode
Attach Mode
The +check Mode
Thread-debugging in Interactive mode
Interactive mode of thread debugging is available for multi-threaded applications
running on HP-UX 11iv2, or HP-UX 11iv3.
Using thread-debugging feature in HP WDB
Complete the following steps to use the thread-debugging feature in interactive mode:
1. Compile the program with –mt option to include threads in compilation:
$ cc mt o a.out filename.c
2. Navigate to the path where gdb is available.
3. Enter the following command to invoke gdb:
$ ./gdb
18