The Best of Visual Studio 2010: Adding labels to Breakpoints

Tips Search

If you like the tips then you'll love the book!

Order your copy today:
http://www.amazon.com/gp/product/0735649928

The Best of Visual Studio 2010: Adding labels to Breakpoints

  • Comments 4

Keyboard:  ALT + F9, L
Command:  EditorContextMenus.CodeWindow.Breakpoint.BreakpointEditlabels
Versions:  2010
Published:  1/26/2010
Code:  vstipDebug0001

Did you know that Breakpoints now support labels?  They do!  Here is how you use them:

1. Set one or more Breakpoints in your code

 

2. Open the Breakpoint window (CTRL + ALT + B)

image

3. Notice the new "Labels" column?  Just Right-Click on your Breakpoint and choose "Edit Labels" (ALT + F9, L)

image

4. You get this cool new dialog:

image

5. You can type in one (or more) labels for the Breakpoint, then click OK.  You should see your labels on your Breakpoint:

image

Okay so how does this help you?  Well, first, you can now put friendly names for Breakpoints to make them easier to understand.  Second, you can sort by the label names.  And, third, you can SEARCH the labels when you have a lot of Breakpoints. 

  • Very useful! Now if only the older version of VS had that feature...

  • The best part is that we export the labels and breakpoints and share it :D.

  • If I ever had enough breakpoints to label and sort them, I'd simplify my code. Aren't breakpoints temporary, anyway? Wouldn't permanent log statements work better, especially in production?

    Please give us an example of when you would use this feature as opposed to one of these other options. Thanks.

  • Hey Now Zain,

    This sounds nice & nifty. Great post, of all the content on VS10 I've seen so far I never saw this one.  

    Thx 4 the info,

    Catto

Page 1 of 1 (4 items)
Leave a Comment
  • Please add 7 and 6 and type the answer here:
  • Post