Debugging with GDB Manual HP WDB v6.3 (5900-2180, August 2012)

14.11.5 Thread Debugging in Batch Mode
HP WDB supports batch mode of debugging threads for HP-UX 11iv2 and later, on Integrity systems
and on HP-UX 11i v3 in PA-RISC systems for 64 bit applications. The debugger provides a log file
with the list of thread-related errors that occur in the application.
In batch mode, the debugger detects the all the thread-conditions that are detected during an
interactive debugging session.
The debugger reports extended information such as variable address, name, id and other
specifications related to the involved pthread objects. In addition, it displays the stack trace of the
executing thread at the point of error.
NOTE: Use the set frame-count setting in the rtconfig file to control the depth of the stack
trace file. This command controls the depth of the call stack collected. Larger values increase the
run time.
14.11.5.1 Pre-requisites for Batch mode of Thread Debugging
The various prerequisites for Batch mode of Thread Debugging are as follows:
The thread-debugging feature in HP WDB is dependent on the availability of the dynamic
linker version B.11.19.
Advanced thread-debugging feature requires the pthread tracer library which is available by
default on systems running HP-UX 11i v2 or later.
Steps to debug threads in batch mode
1. Compile the source files.
Set the LD_LIBRARY_PATH environment variable, based on the platform as follows:
For 32 bit IPF applications, set
LD_LIBRARY_PATH=/opt/langtools/wdb/lib/hpux32
For 64 bit IPF applications, set
LD_LIBRARY_PATH=/opt/langtools/wdb/lib/hpux64
For 64-bit PA applications, set
LD_LIBRARY_PATH=/opt/langtools/wdb/lib/pa20_64
2. Map the share libraries as private for HP 9000 systems using the following command:
$ chatr +dbg enable ./<executable>
NOTE: This step is not applicable for Integrity systems.
3. Create a configuration file, rtcconfig to specify the various thread conditions that you want
the debugger to detect.
146 HP-UX Configuration-Specific Information