Iris Classon
Iris Classon - In Love with Code

Conditional breakpoints FTW

During some debugging today at work while fine tuning an image comparison algorithm one of our developers needed to set some conditional breakpoints instead of breaking each and every passing when iterating over data. While thinking aloud the question of how came up and I showed how this can be done in Visual Studio. Thinking of it, I should be using this more, I just get lazy sometimes and do more manual work instead- which isn’t very smart of me. You can set an expression, hit count (which is great when the breakpoint hit only matters after X nr of hits, or dividable by Y) and a rudimentary filter. You can then print to the output window and skip the breakpoint, or do both, or just break into.

Just add a breakpoint (F9, or right click, or Debug tab), then hover over it in the breakpoint lane and select conditions and/or actions.

Have fun debugging <3

Comments

Leave a comment below, or by email.


Last modified on 2015-11-24

comments powered by Disqus