Freigeben über


New Threads Window in Visual Studio 2010

Hi, my name is Alex Bulankou and I'm a dev on Visual Studio Debugger team. This is my first post and I'm hoping the screenshots will compensate for the boring rest.

Anyway, if you, like me, need to routinely debug multi-threaded applications and if you had a chance (and bandwidth) to download Visual Studio 2010 Beta1, you might have noticed the Threads window has significantly changed. Now it supports inline callstacks, grouping, column selection, searching contents, including callstack, and custom flagging. A couple of new columns have been added. I’d like to briefly focus on each of them and post some screenshots (based on Beta1 build).

Grouping and Column Selection

You can group and select columns by clicking on the column selector button on the grid header. The threads window is multi-process, i.e. it lists the threads from all processes, which is different from the Threads window in Visual Studio 2008 that only displayed the threads from current process, and default grouping is by process name. I personally have found quite useful to group by flag indicator - especially if I'm debugging a program that has lots of threads and would like to only focus on a couple of them. For example on this screenshot you the Threads window grouped by flag indicator with unflagged threads group collapsed.

Thread Window Grouping

Searching Thread Window Contents

Being able to search contents has become almost a de-facto standard, and the new threads window takes search idea one step further allowing you to search thread callstack. Since walking callstacks can have performance implications, you need to explicitly allow it by setting the toggle button on the toolbar

Searching

If you leave the search term in the search box, the results will continue being filtered out, however "Search Callstack" toggle button will get reset to avoid unintended re-walking of the callstack with each step.

 

Custom Flagging Options

New thread window lets you find threads that run the code from a specific module. Here's how how to use - click on the Flag dropdown on the toolbar and select "Flag Custom Module Selection...". A dialog appears where you can check one or more modules and the Threads window will initiate the search of the callstacks and will flag the threads that have at least one frame running in the selected module.

Flagging by module

 

New Thread Window Columns

In addition to changes to Location column to make it expandable, there were two new columns added - Managed ID and Affinity Mask. Managed ID is System.Threading.Thread.ManagedThreadID property that is defined on managed threads. Affinity Mask shows thread processor affinity in binary form. That is essentially the value that you can set or retrieve using SetThreadAffinityMask API-s.

Well, that's all for now we are really hoping get some feedback on all the changes and new functionality. Happy multi-threaded debugging!