Visual Studio Debugging - Conditional Break Points

Hello Casey, just watched the 50th episode and saw you debugging a loop and wanted to point out that there are conditional break points in Visual Studio.

You can set it to break when a specific variable is set to a specific value.

Right click on the breakpoint and select "Condition..."

Here's one more trick I often use when debugging with Visual Studio.

If you missed execution of some part of code, you can easily retry it without restart program, by simply moving instruction pointer back to beginning of calculation. Often you can repeat calculation without breaking anything, and this can help to speed up debugging.

To do that drag&drop that yellow arrow on left side of code window.


Or choose "Set Next Statement" (Ctrl+Shift+F10) in popup menu on right mouse button.

Edited by Mārtiņš Možeiko on
Yes, I know about these two options but I do not prefer them. It's very simple to just insert code into the program, and it does not have the limitations of the conditional breakpoints nor the unreliability of Set Next Statement.

- Casey