Debugging with GDB (February 2008)

Table Of Contents
162 Debugging with GDB
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 IPF 32 bit applications, set
LD_LIBRARY_PATH=/opt/langtools/wdb/lib/hpux32
- For IPF 64 bit applications, set
LD_LIBRARY_PATH=/opt/langtools/wdb/lib/hpux64
- For PA 64 bit 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 com-
mand:
$ 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.
Note: The configuration file contains lines of the following form:
set thread-check [on|off] | [option] [on|off] | [option] [num]
And/Or
set frame-count [num]
And/Or
files=<name of the executable on which the thread checking is to be
done>
For more information, Section 14.11.3.2 [Enabling and Disabling Advanced Thread
Debugging Features], page 157
4. Set the environment variable BATCH_RTC to on as: Set BATCH_RTC=on
5. Preload the librtc runtime library explicitly and start the target application using
one of the following commands:
- For 32 bit IPF applications,
LD_PRELOAD=/opt/langtools/lib/hpux32/librtc.so <executable>
- For 64 bit IPF applications,
LD_PRELOAD=/opt/langtools/lib/hpux64/librtc.so <executable>
- For 64 bit PA applications,
LD_PRELOAD=/opt/langtools/lib/pa20_64/librtc.sl <executable>