Freigeben über


Setting a Breakpoint Filter

Menu:  [Right-Click] -> Filter; Tools -> Options -> Debugging -> General
Versions:  2008,2010
Published:  5/6/2010
Code:  vstipDebug0024

 

Breakpoint Filters are very cool!  They are used when you want to take your Breakpoints to the next level and break based on thread, process, and/or machine.  Just make sure you can set them by going to Tools -> Options -> Debugging -> General and put a check in the "Enable breakpoint filters" checkbox:

image

 

To make a Breakpoint Filter just Right-Click any regular Breakpoint and choose "Filter":

image

 

You will get the Breakpoint Filter dialog:

image

 

As you can see, I've decided to break whenever the Breakpoint is hit AND the thread name is "bubba".  Here is what it looks like in the Threads window when I actually run my code and the Breakpoint is hit:

image

 

If you want to try this out for yourself, check out the threading demo script here:

https://cid-3dc455e4300aedb6.skydrive.live.com/browse.aspx/Public/Visual%20Studio%202010%20-%20NET%20Framework%204/What%5E4s%20New%20in%20Visual%20Studio%202010

Comments

  • Anonymous
    May 06, 2010
    Zain Excellent Job carrying on Sara’s tradition – have loved the tips on Breakpoints  – just like with Bookmarks (CTRL-K-K & CTRL-K-N have become my friends), there is much that can be very useful with Breakpoints if a person is just aware of them which is why I like your Feed– keep up the good work.

  • Anonymous
    May 08, 2010
    Seriously great feature..! Wasn't aware with this feature, sometimes useless breakpoints disturbs a lot :-p thanks for sharing.

  • Anonymous
    May 08, 2010
    Great article. I think this similar feature was in VS 2008. Isn' t it or am i wrong?

  • Anonymous
    May 09, 2010
    adeel -  yep I think this one may go back even further to 2005 but defintiely in 2008. Z