Is there a shortcut in VS for "next statement in current thread"?

When debugging multithreaded .NET applications in VS (2008), I often want to go through the code. When I press F10 quite often, I find VS hopping for approval in another thread. It really confuses me and always throws me away.

I can get around this by throwing a million breakpoints.

Is there a cleaner way to ask the VS debugger to go to the next instruction in the current thread?

+4
source share
3 answers

John Robbins, the authority on Windows debugging, has published only a macro that allows you to freeze and thaw threads in VS 2008.

It certainly makes things a lot easier. Thread interdependencies can lead to problems, however, this is an almost acceptable solution.

+2
source

Probably a much simpler way is to freeze any thread that you are not interested in tracing (right-click in the Threads window). This may mean a little manual manipulation for you and will not accurately represent the interaction of the flows, but you will not move from one thread to another.

+3
source

Agree with @Alan McBee. I think that in VS 2010 they add the command "freeze all threads except this one", which will also make it easier. But I think that there is no other way to achieve your goal (for example, you need to either freeze threads or set breakpoints).

0
source

All Articles