multithreading 如何获取 GDB 中所有线程的回溯?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18391808/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I get the backtrace for all the threads in GDB?
提问by srikantha ks
Is there an equivalent command in GDB to that of WinDbg's "!process 0 7"?
GDB 中是否有与 WinDbg 的“!process 0 7”等效的命令?
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?
我想提取转储文件中的所有线程以及它们在 GDB 中的回溯。“信息线程”不输出堆栈跟踪。那么,有没有这样的命令呢?
回答by Sharad
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.
一般使用backtrace来获取当前线程的堆栈信息,但是如果有必要获取所有线程的堆栈信息,可以使用下面的命令。
thread apply all bt
回答by Employed Russian
Is there a command that does?
有没有可以执行的命令?
thread apply all where