Search code examples
multithreadingvisual-studio-2015visual-studio-debugging

Debug only the thread the first breakpoint hits


I recently switched to a brand new PC and recognized that remote debugging in VS 2015 suddenly got painfully slow with repeating 5-10 second VS application hangs while I am stepping through with F10. I didn't have this problem at all on my old client. I found out that my old VS 2015 only steps through the thread which includes the first breakpoint I hit. This is totally sufficient for almost all my needs and so much faster in remote debugging, too.

As there seems no setting for this in VS I assume this behavior comes from a patch I installed for VS 2008 SP1, which had some problems with debugging (https://support.microsoft.com/en-us/help/957912/updates-for-visual-studio-2008-sp1-debugging-and-breakpoints). Now I don't wanna go through installing VS 2008 SP1, the patch and then VS 2015 to test this out. Is there any other easy (no freeze/thaw clickclick) way to get VS to ignore the other threads?


Solution

  • (1) Certain extension tool like "Debug Single Thread" would be a path for this issue:

    https://marketplace.visualstudio.com/items?itemName=mayerwin.DebugSingleThread

    (2) Use the Thread Id to Filter the thread and select the one you just want to debug is also a workaround I know.

    How to debug a single thread in Visual Studio?