How to set conditional breakpoints in Visual Studio?

前端 未结 13 2403
忘了有多久
忘了有多久 2020-11-27 03:35

Is there an easy way to set conditional breakpoints in Visual Studio?

If I want to hit a breakpoint only when the value of a variable becomes something, how can I do

13条回答
  •  面向向阳花
    2020-11-27 04:23

    Create a conditional function breakpoint:

    1. In the Breakpoints window, click New to create a new breakpoint.

    2. On the Function tab, type Reverse for Function. Type 1 for Line, type 1 for Character, and then set Language to Basic.

    3. Click Condition and make sure that the Condition checkbox is selected. Type instr.length > 0 for Condition, make sure that the is true option is selected, and then click OK.

    4. In the New Breakpoint dialog box, click OK.

    5. On the Debug menu, click Start.

提交回复
热议问题