我已将gdb附加到一个长时间运行的进程(> 25小时)。为了管理会话,我在Ubuntu计算机上使用了屏幕。我可以找回会议。我回到了gdb控制台。但是在继续时,我看到我的流程抛出SIGABRT
并退出,随后是其他流程退出消息。
[New LWP 122]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007fe8ef29ea15 in futex_abstimed_wait_cancelable (private=0, abstime=0x7ffc8c628420, expected=0, futex_word=0x7fe8e6378640) at ../sysdeps/unix/sysv/
linux/futex-internal.h:205
205 ../sysdeps/unix/sysv/linux/futex-internal.h: No such file or directory.
(gdb) c
Continuing.
(gdb) [Thread 0x7be8d8bfd700 (LWP 48) exited]
Thread 32 "my-process" received signal SIGABRT, Aborted.
[Switching to Thread 0x7be8d2bbd700 (LWP 60)]
0x00007fe8eece4428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
54 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) c
Continuing.
Couldn't get registers: No such process.
Couldn't get registers: No such process.
Couldn't get registers: No such process.
(gdb) [Thread 0x7be8b67ff700 (LWP 119) exited]
[Thread 0x7be8b49fe700 (LWP 122) exited]
...
那之后,我无法获得gdb控制台。尽管我在运行ps -ef
root 133 0 1 Jan14 ? 00:26:09 gdb --pid=23
如何为该gdb进程找回控制台?我想看看回溯。 还是有更好的方法将gdb附加到长时间运行的进程?