Setting a Breakpoint in the Call Stack Window

Keyboard:  F9 (toggle Breakpoint)
Menu:  Debug -> Toggle Breakpoint
Command:  Debug.ToggleBreakpoint
Versions:  2008,2010
Published:  2/5/2010
Code:  vstipDebug0008

 

This tip has been around a long, long time and yet people still don't seem to know about it.  So.for your enjoyment we present an Old School tip today:

 

  1. First set a Breakpoint deep in series of calls to get a nice call stack
    NOTE:  if you don't have that handy just make a bunch of methods called One, Two, Three, etc.. and have them call each other like I have in these examples.

  2. Run your code and let it stop at the Breakpoint.

  3. Bring up your Call Stack Window (CTRL + ALT + C or Debug -> Windows -> Call Stack)

    image

  4. See where you currently are in the Call Stack?  Well, what if you want to stop at one or more places as the call stack unwinds?

  5. Click somewhere in the call stack you would like to stop at as it unwinds and press the function key F9:

    image

  6. It set a Breakpoint!  You can verify this by looking in your Breakpoints Window:

    image

  7. Now just press F5 to continue and watch as the debugger stops at the place you told it to:

    image

So there you have it.  You can set Breakpoints right in the Call Stack Window!