I'm trying to get a stack trace as my service got into a deadlock. I'm using
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 the threads to pipe to a file in a single command?
Logging GDB's output to a file This is done by first issuing the command set logging file my-gdb-log , followed by the command set logging on . Later on, you can issue the set logging off command to stop sending GDB output to the log file.
Analyze external stack tracesFrom the main menu, select Code | Analyze Stack Trace or Thread Dump. In the Analyze Stack Trace dialog that opens, paste the external stack trace or thread dump into the Put a stacktrace here: text area. Click OK. The stack trace is displayed in the Run tool window.
A full stack trace allows you to see the chain of files from when your custom tag reached your set breakpoint. If you click on any of the pages in the caller chain then FusionDebug will show you that page and will highlight the line at which the next page in the chain was called.
You should turn off pagination for long outputs like this:
$ gdb <binary> core.dump
(gdb) set logging on
(gdb) set pagination off
(gdb) thread apply all bt full
See gdb FAQ and documentation:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With