Visual Studio Debug只在一个线程中

问题描述 投票:2回答:2

我使用VS2017来调试我的C ++应用程序。但是,当我使用单步调试时,它会自动切换到某个线程,我只想调试一个特定的线程。我怎么能这样做?

c++ windows multithreading visual-studio debugging
2个回答
1
投票

断点

您可以配置VS2017调试器以仅过滤特定线程。按照this msdn博客申请一个断点。您想要在ThreadId上过滤。


线程窗口

另一种方式是通过Threads Window。在这里,您可以查看应用程序中的所有活动线程。

  1. 调试> Windows>线程
  2. 右键单击所需的线程
  3. 单击切换到线程

0
投票

您可以尝试使用此扩展工具:

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

实际上其他成员也发布了此功能请求,并在此处分享了一些评论建议:

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

如果可能,您可以查看它,但如果所有建议或解决方法都不是您想要获得的,您还可以投票并添加您对上述功能请求的评论。

© www.soinside.com 2019 - 2024. All rights reserved.