Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to dump or search in call stacks of ALL threads in 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.

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

like image 311
superb Avatar asked Jan 27 '11 04:01

superb


2 Answers

In VS 2019 (and may be in others)

Main menu: Debug -> Windows -> Threads

Shows Threads tab which lists all threads, for each thread you can expand stack trace and there is a search which can cover stack traces - so that after search you'll get only threads which include required words:

enter image description here

like image 93
sarh Avatar answered Sep 19 '22 14:09

sarh


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: https://web.archive.org/web/20150627064016/http://blogs.msdn.com/b/greggm/archive/2005/08/02/446899.aspx

like image 28
Jakob Avatar answered Sep 20 '22 14:09

Jakob