当我的服务陷入僵局时,我正在尝试获取堆栈跟踪。 我正在使用
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?
有什么技巧可以在单个命令中获取所有线程的堆栈跟踪以通过管道传输到文件?
最佳答案
你应该像这样关闭长输出的分页:
$ gdb <binary> core.dump
(gdb) set logging on
(gdb) set pagination off
(gdb) thread apply all bt full
请参阅 gdb 常见问题解答和文档:
关于c++ - 如何将 gdb 的完整堆栈跟踪传输到文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26805197/