Keyboard: F9 (toggle Breakpoint)
Menu: Debug -> Toggle Breakpoint
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:
- 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.
- Run your code and let it stop at the Breakpoint.
- Bring up your Call Stack Window (CTRL + ALT + C or Debug -> Windows -> Call Stack)
- 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?
- Click somewhere in the call stack you would like to stop at as it unwinds and press the function key F9:
- It set a Breakpoint! You can verify this by looking in your Breakpoints Window:
- Now just press F5 to continue and watch as the debugger stops at the place you told it to:
So there you have it. You can set Breakpoints right in the Call Stack Window!