如何在Visual Studio中转储或在所有线程的调用堆栈中搜索 [英] How to dump or search in call stacks of ALL threads in Visual Studio
问题描述
如何在Visual Studio中转储或搜索所有线程的调用堆栈?我们有一个服务器进程要调试,它有数百个正在运行的线程,因此手动检查每个线程应该很困难.
How to dump or search in call stacks of ALL threads in Visual Studio? We have a server process to debug and it has hundreds of threads running, so it should be hard to manually check each threads.
我知道gdb中的线程应用"可以做这种事情.所以我想知道Visual Studio的调试器中是否有类似的功能.
I know "thread apply" in gdb can do this kind of things. So I was wondering is there anything similar available in visual studio's debugger.
我还使用了Visual Studio 2005,因此请提供VS 2005的解决方案(在VS 2010中提供了所有调用堆栈中的搜索....)
Also I was using visual studio 2005, so please give a solution for VS 2005 ( search in all call stack is provided in VS 2010...).
推荐答案
后来我通过使用WinDbg找到了答案,
Later I found the answer by using WinDbg,
首先在VS调试会话中保存一个小型转储,例如myapp.dmp
First save a minidump in VS debug session, say, myapp.dmp
然后使用以下命令将所有调用堆栈转储到out.txt
Then using the following command to dump all callstack to out.txt
cdb -z c:\ myapp.dmp -logo out.txt -lines -c〜* kb; q" -y c:\ symbols
cdb -z c:\myapp.dmp -logo out.txt -lines -c "~*kb;q" -y c:\symbols
这篇关于如何在Visual Studio中转储或在所有线程的调用堆栈中搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!