You can run other debugger commands to examine process information. For example, the backtrace command displays frame stacks, as shown in the following example:
(gdb) backtrace
#0 0x0000003774c080ad in pthread_join () from /lib64/libpthread.so.0
#1 0x00007f32c7af6505 in ContinueInNewThread0 ()
from /apps/sas/SAS9x/GOLD/SASHome/SASPrivateJavaRuntimeEnvironment/9.4/jre/bin/../lib/amd64/jli/libjli.so
#2 0x00007f32c7aeb58a in ContinueInNewThread ()
from /apps/sas/SAS9x/GOLD/SASHome/SASPrivateJavaRuntimeEnvironment/9.4/jre/bin/../lib/amd64/jli/libjli.so
#3 0x00007f32c7aee0e0 in JLI_Launch ()
from /apps/sas/SAS9x/GOLD/SASHome/SASPrivateJavaRuntimeEnvironment/9.4/jre/bin/../lib/amd64/jli/libjli.so
#4 0x0000000000400686 in main ()
(gdb)
In the next example, the info threads command displays thread information such as thread numbers, the target system's thread identifier, and the thread name:
(gdb) info threads
12 Thread 0x7f32c6c7f700 (LWP 2764) 0x0000003774c0b7bb in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
11 Thread 0x7f32c618e700 (LWP 2765) 0x0000003774c0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
10 Thread 0x7f32c608d700 (LWP 2766) 0x0000003774c0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
9 Thread 0x7f32c4c26700 (LWP 2767) 0x0000003774c0b7bb in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
8 Thread 0x7f32c4b25700 (LWP 2768) 0x0000003774c0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
7 Thread 0x7f32c4a24700 (LWP 2769) 0x0000003774c0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
6 Thread 0x7f32c4923700 (LWP 2770) 0x0000003774c0d720 in sem_wait () from /lib64/libpthread.so.0
5 Thread 0x7f32c4822700 (LWP 2771) 0x0000003774c0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
4 Thread 0x7f32c4721700 (LWP 2772) 0x0000003774c0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
3 Thread 0x7f32c4620700 (LWP 2773) 0x0000003774c0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
2 Thread 0x7f32c451f700 (LWP 2774) 0x0000003774c0b7bb in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
* 1 Thread 0x7f32c7ae7700 (LWP 2763) 0x0000003774c080ad in pthread_join () from /lib64/libpthread.so.0
(gdb)
You can also issue the thread command with the following arguments to display the frame stacks of all threads:
(gdb) thread apply all backtrace
Thread 11 (Thread 0x7f32c618e700 (LWP 2765)):
#0 0x0000003774c0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00007f32c748f0b3 in os::PlatformEvent::park() ()
from /apps/sas/SAS9x/GOLD/SASHome/SASPrivateJavaRuntimeEnvironment/9.4/jre/lib/amd64/server/libjvm.so
#2 0x00007f32c7456a1f in Monitor::IWait(Thread*, long) ()
from /apps/sas/SAS9x/GOLD/SASHome/SASPrivateJavaRuntimeEnvironment/9.4/jre/lib/amd64/server/libjvm.so
#3 0x00007f32c74571ae in Monitor::wait(bool, long, bool) ()
from /apps/sas/SAS9x/GOLD/SASHome/SASPrivateJavaRuntimeEnvironment/9.4/jre/lib/amd64/server/libjvm.so
#4 0x00007f32c71cf903 in GCTaskManager::get_task(unsigned int) ()
from /apps/sas/SAS9x/GOLD/SASHome/SASPrivateJavaRuntimeEnvironment/9.4/jre/lib/amd64/server/libjvm.so
#5 0x00007f32c71d0fc8 in GCTaskThread::run() ()
from /apps/sas/SAS9x/GOLD/SASHome/SASPrivateJavaRuntimeEnvironment/9.4/jre/lib/amd64/server/libjvm.so
#6 0x00007f32c7495538 in java_start(Thread*) ()
from /apps/sas/SAS9x/GOLD/SASHome/SASPrivateJavaRuntimeEnvironment/9.4/jre/lib/amd64/server/libjvm.so
#7 0x0000003774c07851 in start_thread () from /lib64/libpthread.so.0
#8 0x00000037748e890d in clone () from /lib64/libc.so.6
. . . more thread lines. . .
Thread 6 (Thread 0x7f32c4923700 (LWP 2770)):
#0 0x0000003774c0d720 in sem_wait () from /lib64/libpthread.so.0
#1 0x00007f32c7493fda in check_pending_signals(bool) ()
from /apps/sas/SAS9x/GOLD/SASHome/SASPrivateJavaRuntimeEnvironment/9.4/jre/lib/amd64/server/libjvm.so
#2 0x00007f32c748d675 in signal_thread_entry(JavaThread*, Thread*) ()
from /apps/sas/SAS9x/GOLD/SASHome/SASPrivateJavaRuntimeEnvironment/9.4/jre/lib/amd64/server/libjvm.so
#3 0x00007f32c75cd5ff in JavaThread::thread_main_inner() ()
from /apps/sas/SAS9x/GOLD/SASHome/SASPrivateJavaRuntimeEnvironment/9.4/jre/lib/amd64/server/libjvm.so
#4 0x00007f32c75cd705 in JavaThread::run() ()
from /apps/sas/SAS9x/GOLD/SASHome/SASPrivateJavaRuntimeEnvironment/9.4/jre/lib/amd64/server/libjvm.so
#5 0x00007f32c7495538 in java_start(Thread*) ()
from /apps/sas/SAS9x/GOLD/SASHome/SASPrivateJavaRuntimeEnvironment/9.4/jre/lib/amd64/server/libjvm.so
#6 0x0000003774c07851 in start_thread () from /lib64/libpthread.so.0
#7 0x00000037748e890d in clone () from /lib64/libc.so.6
. . . more thread lines. . .
Thread 1 (Thread 0x7f32c7ae7700 (LWP 2763)):
#0 0x0000003774c080ad in pthread_join () from /lib64/libpthread.so.0
#1 0x00007f32c7af6505 in ContinueInNewThread0 ()
from /apps/sas/SAS9x/GOLD/SASHome/SASPrivateJavaRuntimeEnvironment/9.4/jre/bin/../lib/amd64/jli/libjli.so
#2 0x00007f32c7aeb58a in ContinueInNewThread ()
from /apps/sas/SAS9x/GOLD/SASHome/SASPrivateJavaRuntimeEnvironment/9.4/jre/bin/../lib/amd64/jli/libjli.so
#3 0x00007f32c7aee0e0 in JLI_Launch ()
from /apps/sas/SAS9x/GOLD/SASHome/SASPrivateJavaRuntimeEnvironment/9.4/jre/bin/../lib/amd64/jli/libjli.so
#4 0x0000000000400686 in main ()
(gdb)
If you want to inspect all registers, issue the info command with the all-registers argument:
(gdb) info all-registers
rax 0xfffffffffffffdfc -516
rbx 0x0 0
rcx 0xffffffffffffffff -1
rdx 0x1 1
rsi 0x189 393
rdi 0x7f32c000a654 139855946360404
rbp 0x7f32c6c7e5d0 0x7f32c6c7e5d0
rsp 0x7f32c6c7e510 0x7f32c6c7e510
r8 0x7f32c000a628 139855946360360
r9 0xffffffff 4294967295
r10 0x7f32c6c7e590 139856060081552
r11 0x202 514
r12 0x1 1
r13 0x7f32c6c7e590 139856060081552
r14 0xffffffffffffff92 -110
r15 0x0 0
rip 0x3774c0b7bb 0x3774c0b7bb <pthread_cond_timedwait@@GLIBC_2.3.2+315>
eflags 0x202 [ IF ]
cs 0x33 51
ss 0x2b 43
ds 0x0 0
es 0x0 0
fs 0x0 0
gs 0x0 0
st0 0 (raw 0x00000000000000000000)
st1 0 (raw 0x00000000000000000000)
st2 0 (raw 0x00000000000000000000)
st3 0 (raw 0x00000000000000000000)
st4 -nan(0xc000000000000000) (raw 0xffffc000000000000000)
st5 -nan(0xc000000000000000) (raw 0xffffc000000000000000)
st6 0 (raw 0x00000000000000000000)
st7 0 (raw 0x00000000000000000000)
fctrl 0x37f 895
fstat 0x21 33
ftag 0xffff 65535
fiseg 0x7f32 32562
fioff 0xc7526f48 -950898872
foseg 0x7f32 32562
fooff 0xc6c7cab0 -959984976
fop 0x0 0
mxcsr 0x1fa1 [ IE PE IM DM ZM OM UM PM ]
ymm0 {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double = {0x0, 0x0, 0x0, 0x0}, v32_int8 = {
0x0 <repeats 32 times>}, v16_int16 = {0x0 <repeats 16 times>}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int64 = {0x0,
0x0, 0x0, 0x0}, v2_int128 = {0x00000000000000000000000000000000, 0x00000000000000000000000000000000}}
. . .more register lines. . .
(gdb)
To save all of the data into a core-dump file, issue the gcore command:
(gdb) gcore
Saved corefile core.2763
The detach command detaches the debugger from the process:
(gdb) detach
Detaching from program: /apps/sas/SAS9x/GOLD/SASHome/SASPrivateJavaRuntimeEnvironment/9.4/jre/bin/java, process 2763
Finally, the quit command exits from the debugger.
(gdb) quit