Debugging with GDB Manual (5900-1473; WDB 6.2; January 2011)

Table Of Contents
OR
Instead of automatically preloading librtc and mapping the shared libraries,
you can explicitly preload the required librtc library after mapping the shared
libraries private.
In the case of HP 9000 systems, you must explicitly map the share libraries as
private by using the +dbg enable option for the chatr command, as follows:
$ chatr +dbg enable ./<executable>
(This step is not required on Integrity systems.)
To explicitly preload the librtc runtime library and start the target application,
enter 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>
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.
4. Complete one of the following steps:
Attach the debugger to the required process and enable thread debugging, as
follows:
gdb [-thread | -threads] -p <pid>
or
gdb [-thread | -threads] <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
184 HP-UX Configuration-Specific Information