From the course: Visual Studio: Advanced Debugging Tools

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Conditional breakpoints from Thread ID

Conditional breakpoints from Thread ID - Visual Studio Tutorial

From the course: Visual Studio: Advanced Debugging Tools

Start my 1-month free trial

Conditional breakpoints from Thread ID

- [Instructor] Imagine for a minute that this for loop counts from one to five thousand, and I'd like to put a breakpoint on line 35 that stops somewhere near the middle of that loop. In other words, around counter equals 2500. You don't want to have to press F5 or F11 or step through your code 2500 times, to get to this line of code. You can use a conditional breakpoint instead. You can also use a conditional breakpoint with the thread ID, which is why it's in this chapter. To create a conditional breakpoint, hover over the red circle and click on settings and choose conditions. There's several choices in this dropdown. We're interested in this top one, conditional expression is true. And then you write the expression here, which is counter equal to three. Press enter to save that value and then close this popup. And notice there's a white plus sign and it appears in the center of the breakpoint. And also, if I…

Contents