In short, right click on an existing breakpoint and select "Edit breakpoint", or right click on the breakpoint margin and select "Add conditional breakpoint".
Conditional breakpoints allow you to break inside a code block when a defined expression evaluates to true. Conditional breakpoints highlight as orange instead of blue. Add a conditional breakpoint by right clicking a line number, selecting Add Conditional Breakpoint , and entering an expression.
Conditional Breakpoints in WinDbg In WinDbg, you can create a conditional breakpoint by clicking Breakpoints from the Edit menu, entering a new breakpoint address into the Command box, and entering a condition into the Condition box.
Press F3 and then press F9 to add a breakpoint.
Set a breakpoint as usual. Right click it. Click Condition.
When you are using Express edition you can try this:
#if DEBUG
if( fooVariable == true )
System.Diagnostics.Debugger.Break();
#endif
if statement makes sure that in release build breakepoint will not be present.
Visual Studio provides lots of options for conditional breakpoints:
To set any of these you
These options are as follows:
foo == 8
or some other expression.Just another way of doing it, (or if you are using express) add the condition in code:
if(yourCondition)
{
System.Diagnostics.Debugger.Break();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With