简体   繁体   English

到达 C++ 本机断点时,如何不暂停 Visual Studio 2022 中的所有线程?

[英]How not suspend all threads in Visual Studio 2022 when C++ native breakpoint is reached?

I'm using Visual Studio 2022. I want to set a breakpoint and have the threads that reach it suspend, but I want those threads that have not reached a breakpoint to continue executing as though nothing has happened.我正在使用 Visual Studio 2022。我想设置一个断点并让到达它的线程挂起,但我希望那些尚未到达断点的线程继续执行,就好像什么都没发生一样。 Unavoidable consequences of doing this are acceptable to me.这样做的不可避免的后果是我可以接受的。 In my code, I will have properly synchronized between threads, copied data, and so on.在我的代码中,我将在线程、复制数据等之间正确同步。 If I do see an unexpected consequence then I've found a bug or learned something interesting about my code.如果我确实看到了意想不到的后果,那么我就发现了一个错误或对我的代码了解了一些有趣的东西。

I found this Stack Overflow article regarding Visual Studio 2008.我发现这篇关于 Visual Studio 2008 的 Stack Overflow 文章。

VS2008 Suspending all threads upon hitting breakpoint VS2008 在遇到断点时暂停所有线程

The article unofficially says Visual Studio 2008 cannot do what I'm asking for in this question.这篇文章非正式地说 Visual Studio 2008 不能做我在这个问题中所要求的。 Version 2008 is many versions before today's 2022 yet I still have not found that for which I'm looking. 2008 版是今天 2022 年之前的许多版本,但我仍然没有找到我正在寻找的版本。

Before I give up my search, I'm asking this community, Is there a way in Visual Studio C++ native projects to suspend only threads that have reached breakpoints and have all others continue?在我放弃搜索之前,我问这个社区,在 Visual Studio C++ 本地项目中是否有办法只暂停已达到断点的线程并让所有其他线程继续?

In the thread panel, you can resume the execution of the other threads.在线程面板中,您可以恢复其他线程的执行。
If you want that the other threads does not stop, I don't know a way of doing it sadly.如果您希望其他线程不停止,我不知道如何做到这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM