gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 20:12:35 26 4
gpt4 key购买 nike

当我的服务陷入僵局时,我正在尝试获取堆栈跟踪。我正在使用

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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com