c – 如何将gdb的完整堆栈跟踪传输到文件?

c – 如何将gdb的完整堆栈跟踪传输到文件?,第1张

概述我正试图获得堆栈跟踪,因为我的服务陷入了僵局. 我正在使用 gdb <binary> core.dumpgdb> set logging ongdb> 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 ar 我正试图获得堆栈跟踪,因为我的服务陷入了僵局.
我正在使用

gdb <binary> core.dumpgdb> set logging ongdb> 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常见问题和文档:

> 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

总结

以上是内存溢出为你收集整理的c – 如何将gdb的完整堆栈跟踪传输到文件?全部内容,希望文章能够帮你解决c – 如何将gdb的完整堆栈跟踪传输到文件?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/1216368.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-06-05
下一篇2022-06-05

发表评论

登录后才能评论

评论列表(0条)

    保存