Debugging with GDB (February 2008)

Table Of Contents
Chapter 14: HP-UX Configuration-Specific Information 161
- For 64-bit PA applications,
LD_LIBRARY_PATH=/opt/langtools/wdb/lib/pa20_64
2. Explicitly preload the librtc runtime library and start the target application by
entering 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 32 bit PA applications,
LD_PRELOAD=/opt/langtools/lib/librtc.sl <executable>
- For 64-bit PA applications,
LD_PRELOAD=/opt/langtools/lib/pa20_64/librtc.sl <executable>
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
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.