Visual Studio 2013: Working in the Breakpoints Window

  NOTE: This is an older feature. I’ve updated the information for VS2013.   The Breakpoints Window (CTRL+ALT+B) is an awesome tool. We use it frequently to aid us in our debugging efforts. Let’s take a look at some of the things you can do when working in this window.       Deleting Breakpoints…


Visual Studio 2013: Working with Breakpoint Labels

  NOTE: This is an older feature. I’ve updated the information for VS2013.   The Breakpoints Window has supported adding labels since VS2010, however most people aren’t aware of this feature. But how does this help you?  Well, first, you can put friendly names for Breakpoints to make them easier to understand.  Second, you can…


Setting a Breakpoint on a Class

General: CTRL + B Visual Basic 6: CTRL + B Visual C# 2005: CTRL + B; CTRL + D, N; CTRL + D, CTRL + N Visual C++ 2: [no shortcut] Visual C++ 6: CTRL + B Visual Studio 6: [no shortcut] Windows: ALT + D, B, F Menu: Debug | New Breakpoint | Break…


Setting a Breakpoint in the Call Stack Window

The text version of this video can be found here: http://blogs.msdn.com/b/zainnab/archive/2010/02/05/setting-a-breakpoint-in-the-call-stack-window-vstipdebug0008.aspx     If you can’t play the embedded video below, you can see it here:  http://www.youtube.com/watch?v=T_H_bLEHVZc   You can also see my entire YouTube channel here: http://www.youtube.com/user/VSTips    


Setting a Breakpoint with Code

Versions:  2008,2010Published:  10/30/2010Code:  vstipDebug0036   There will be times you want code to break when you are debugging without having to set a Breakpoint.  You can do this in your code quite easily.  Here is how you do it:   Compiler Directive In C# and VB you need to set a compiler option that will…


The Immediate Window: Design-Time Breakpoints

Keyboard:  CTRL + ALT + I Menu:  Debug -> Windows -> Immediate Command:  Debug.Immediate Versions:  2008,2010 Published:  9/29/2010 Code:  vstipTool0096   In vstipTool0095 (http://blogs.msdn.com/b/zainnab/archive/2010/09/28/the-immediate-window-working-with-members-vstiptool0095.aspx) I mentioned that you could do design-time execution of members.  I thought it would be instructive to mention that you can also use this technique to hit breakpoints in your code….


Delete All Breakpoints

Keyboard:  CTRL + SHIFT + F9Menu:  Debug -> Delete All BreakpointsCommand:  Debug.DeleteAllBreakpointsVersions:  2008,2010Published:  5/7/2010Code:  vstipDebug0025   You can exercise the nuclear option on your Breakpoints and delete them all.  You have a couple of options:   WARNING: You had better have an export of your Breakpoints before you do either of these options if you…

4

Setting a Breakpoint Filter

Menu:  [Right-Click] -> Filter; Tools -> Options -> Debugging -> GeneralVersions:  2008,2010Published:  5/6/2010Code:  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…

4

Run to Cursor

Keyboard:  CTRL + F10Menu:  [Right-Click] -> Run To CursorCommand:  Debug.RunToCursorVersions:  2008,2010Published:  5/5/2010Code:  vstipDebug0023     This is one that a lot of people have told me to write about.  It’s been around a while but seems to get lost among all the other features that are out there.  Basically, if you have some code and…

3

Set a Complex Breakpoint Condition

Menu:  [Right-Click the Breakpoint] -> ConditionVersions:  2008,2010Published:  5/4/2010Code:  vstipDebug0022     So, it turns out that the REAL power of the Breakpoint Condition dialog is the ability to execute any line of code from it.  You could do something really evil like reset a variable so you have an infinite loop:     Or you…

8