How to debug a single thread in Visual Studio?

后端 未结 10 1616
执笔经年
执笔经年 2020-11-28 17:59

I have a solution with some projects. There are several break-points in different projects. I want to trace the first thread hit one of these break-points and continue traci

10条回答
  •  猫巷女王i
    2020-11-28 18:32

    If you don't want to stop all other threads (maybe you are attaching Visual Studio debugger to a running application that needs to answer to requests), you can use a macro that create and remove breakpoints automatically.

    This is suggested in an answer to Stack Overflow question "Step over" when debugging multithreaded programs in Visual Studio.

    However, the link only explain how to debug line by line. I suggest you modify the macro (if you're comfortable with it) to make it modify all breakpoints (in a given range of line for instance) to stop only on the current thread.

提交回复
热议问题