How to dump or search in call stacks of ALL threads in Visual Studio

白昼怎懂夜的黑 提交于 2019-11-29 01:29:47

问题


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.

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.

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...).


回答1:


I just had the same problem, also in VS2005. I found a simpler solution: While debugging open the command window of VS and use the command: Debug.ListCallStack /AllThreads

I found this on: http://blogs.msdn.com/b/greggm/archive/2005/08/02/446899.aspx




回答2:


Later I found the answer by using WinDbg,

First save a minidump in VS debug session, say, myapp.dmp

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



来源:https://stackoverflow.com/questions/4812645/how-to-dump-or-search-in-call-stacks-of-all-threads-in-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!