I'm using VS2010 Beta 2 to debug some multi-threaded code. Love parallel stacks, etc.
I have a question, though: I have a breakpoint set in a method that may be called by multiple threads. Once I hit the breakpoint, I really want to keep the focus on the thread that triggered the that breakpoint. However, when I hit "step", VS often switches to another thread (say I'm stopped on thread 1, but in the meanwhile, thread 2 hits my breakpoint).
I know that I can manually freeze threads in the thread window. Is there a way to do it automatically -- basically, once I hit a breakpoint, freeze all threads except the current one until I hit F-5?
Not that I'm aware of, however you could disable your breakpoint while you are stepping through.
When I'm worried about confusing many threads I tend to just keep the threads window open and keep a note of the thread id's.
I have just released a Visual Studio 2010 extension that does exactly what you are looking for. And it's free :).
Check it out here on the Gallery, on the official page or the Codeplex repository.
If you load the Threads window from Debug->Windows->Threads.. Once you hit a break point, you can select all the threads and click "Freeze Threads" then you can resume the active thread, selecting it and choosing "Thaw threads".
This will allow only the current thread to execute in the debugger.
There is a blog post by John Robbins on how to do this with a Visual Studio macro.