Visual Studio,调试多个线程之一 [英] Visual Studio, debug one of multiple threads

查看:33
本文介绍了Visual Studio,调试多个线程之一的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,有 4 个线程在运行相同的代码.但是,当我单步执行时,它会在不同的线程之间跳转.如何将其锁定到一个线程以便其他线程在调试时被忽略?

I have an application with 4 threads working the same code. However, when I step it jumps between the different threads. How can I lock it to one thread so the other threads are ignored for debugging?

推荐答案

是.

在线程窗口(调试 -> 窗口 -> 线程)中右键单击您想要的线程并选择切换到线程".

In the Threads window (Debug -> Windows -> Threads) right-click the thread you want and select "switch to thread".

您还可以在不想调试的线程上选择冻结",以防止它们运行.但是,如果您希望它们起作用,请不要忘记解冻"它们.

You can also choose "freeze" on the threads you don't want to debug in order to keep them from running. Don't forget to "thaw" them if you expect them to do work, however.

进一步阅读.

这篇关于Visual Studio,调试多个线程之一的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆