Debugging with GDB (September 2007)
160 Debugging with GDB
- 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 proce ss 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.12 De bugging MPI Programs
You can attach the debugger to Message Passing Interface (MPI) programs for debug-
ging. You must set the one of the following environment variables before you launch
the MPI process:
set MPI_FLAGS= egdb for invoking GDB
or
set MPI_FLAGS= ewdb for invoking WDB
For more information, see the mpidebug(1) and mpienv(1) manpages.
Attaching the debugger to an MPI pro c ess (or to any other process that has not been
compiled for debugging) can result in the follow ing warning:
warning: reading ’r3’ register: No data
14.13 De bugging multiple processes ( programs with fork
and vfork calls)