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

Table Of Contents
export LD_PRELOAD=/opt/langtools/lib/hpux64/librtc.so:/usr/lib/hpux64/libmallocng.so
For 32–bit executable
export LD_PRELOAD=/opt/langtools/lib/hpux32/librtc.so:/usr/lib/hpux32/libmallocng.so
This feature is available only on HP Integrity systems.
14.11 Thread Debugging Support
HP WDB provides thread-debugging support for kernel, user, and MxN threads. You
can exclusively disable or enable specific thread execution. Advanced thread debugging
support in HP WDB enables you to view information on pthread primitives and detect
certain thread-related conditions.
NOTE: HP WDB supports pthread parallelism, but it does not support
compiler-generated parallelism such as parallelism with directives.
14.11.1 Support for Enabling and Disabling Specific Threads
When you suspect that a specific thread is causing a problem while debugging a multi-
threaded application, you can suspend the execution of other threads in the application
and debug the doubtful thread exclusively. HP WDB 3.2 and later versions provide the
following commands to disable and enable specific thread execution:
thread disable This command prevents the specified threads from running until
they are enabled again using the thread enable command.
thread enable This command enables the specified thread to run when you issue
the continue or step command. By default, all threads are in
the enabled state. You can use the thread enable command
to reactivate a disabled thread.
Consider the following example:
(gdb) info threadsystem thread 4189 0x7f666da8
in __pthread_create_system+0x3d8 () from /usr/lib/libpthread.1
2 system thread 4188 worker (wptr=0x40004640 ") at quicksort.c:135
1 system thread 4184 0x7f66f728 in _lwp_create+0x10 () from /usr/lib/libpthread.1
To disable a thread, execute the following command:
(gdb) thread disable 1
warning: ATTENTION!! Disabling threads may result in
deadlocks in the program.Disabling thread 1
To enable a thread, execute the following command:
(gdb) thread enable 1
Enabling thread 1
You can set and view the kernel threads with the help of the following commands:
set show-all-kthreads Sets non-zero integer value so that the gdb reports
all the kernel threads. By default this is set to 0, that
176 HP-UX Configuration-Specific Information