Debugging with GDB (September 2007)

30 Debugging with GDB
[New thread 2 (system thread 26594)]
when GDB notices a new thread.
On HP-UX systems, you can control the display of thread creation messages. Following
commands are used to control the display of thread creation:
set threadverbose on
Enable the output of informational messages regarding thread c reation. The
default setting is on. You can set it to off to stop the display of messages.
set threadverbose off
Disable the output of informational m es sages regarding thread creation. The
default setting is on. You can set it to on to display messages.
show threadverbose
Display whether set threadverb ose is on or off.
Here are commands to get more information about threads:
info threads
Display a summary of all threads currently in your program. GDB displays for
each thread (in this order):
1. the thread number assigned by GDB
2. the target system’s thread identifier (sys tag)
3. the current stack frame summary for that thread
4. the priority of a thread
An asterisk * to the left of the GDB thread number indicates the current
thread.
For example,
(gdb) info threads
* 3 system thread 26607 worker (wptr=0x7b09c318 "@") \
at quicksort.c:137
2 system thread 26606 0x7b0030d8 in __ksleep () \
from /usr/lib/libc.2
1 system thread 27905 0x7b003498 in _brk () \
from /usr/lib/libc.2
thread threadno
Make thread number threadno the current thread. The command argument
threadno is the internal GDB thread number, as shown in the first field of the
info threads display. GDB res ponds by displaying the system identifier of
the thread you selected, and its current stack frame summary:
(gdb) thread 2
[Switching to thread 2 (system thread 26594)]
0x34e5 in sigpause ()
As with the [New ...] message, the form of the text after Switching to
depends on your system’s conventions for identifying threads.