Gordon
Gordon

Reputation: 446

Visual Studio Debug in only one thread

I use VS2017 to debug my C++ app. However, when I utilize single-step debug, it will switch to some thread automatically and I only want to debug one specific thread. How could I go about doing this?

Upvotes: 3

Views: 3978

Answers (2)

Jack Zhai
Jack Zhai

Reputation: 6436

You could try to use this extension tool:

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

Actually other members also post this feature request and shared some suggestions with comments here:

https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/8543248-make-the-debugger-stick-to-the-current-thread-inst

If possible, you could view it, but if all suggestions or workaround are not what you want to get, you could also vote and add your comment for above feature requests.

Upvotes: 0

Impurity
Impurity

Reputation: 1122

Breakpoints

You can configure VS2017 debugger to filter only a specific thread. Follow this msdn blog to apply one to a breakpoint. You want to filter on ThreadId.


Thread Window

Another way is through the Threads Window. Here you can view all active threads in the application.

  1. Debug > Windows > Threads
  2. Right click desired thread
  3. Click switch to thread

Upvotes: 2

Related Questions