如何获取 GDB 中所有线程的回溯? [英] How do I get the backtrace for all the threads in GDB?

查看:30
本文介绍了如何获取 GDB 中所有线程的回溯?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

GDB 中是否有与 WinDbg 的 !process 0 7 等效的命令?

Is there an equivalent command in GDB to that of WinDbg's !process 0 7?

我想提取转储文件中的所有线程以及它们在 GDB 中的回溯.info threads 不输出堆栈跟踪.那么,有没有这样的命令呢?

I want to extract all the threads in a dump file along with their backtraces in GDB. info threads doesn't output the stack traces. So, is there a command that does?

推荐答案

一般情况下使用backtrace来获取当前线程的堆栈,但是如果有必要获取所有线程的堆栈跟踪,使用下面的命令.

Generally, the backtrace is used to get the stack of the current thread, but if there is a necessity to get the stack trace of all the threads, use the following command.

thread apply all bt

这篇关于如何获取 GDB 中所有线程的回溯?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆