How do I pipe a full gdb stack trace to a file?
I am trying to get a stack trace as my service is deadlocked. I use
gdb <binary> core.dump
gdb> set logging on
gdb> thread apply all bt full
... Here now i have to keep pressing ENTER till i get to end of all the thread trace. It takes around 5 mins for me to get all these traces?
Any trick to get the stack trace of all threads to transfer to a file in one command?
+3
user1159517
source
to share
1 answer
You must disable pagination for long exits, for example:
$ gdb <binary> core.dump (gdb) set logging on (gdb) set pagination off (gdb) thread apply all bt full
See the GDB FAQ and documentation:
- https://sourceware.org/gdb/wiki/FAQ#How_do_I_disable_the_.22Type_.3Creturn.3E_to_continue.2C_or_q_.3Creturn.3E_to_quit.22_pagination_prompt_in_GDB.3F
- https://sourceware.org/gdb/onlinedocs/gdb/Screen-Size.html
+7
ks1322
source
to share