Nov 242015
 
 November 24, 2015  Posted by at 12:18 pm Debugging, Visual Studio  Add comments

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.

2015-11-24_16-10-10

2015-11-24_16-10-35

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

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

What is 3 + 3 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)