24

1) I put a breakpoint, VS breaks where I put the breakpoint.

2) I then start browsing around the code normally to put another breakpoint somewhere down the execution path. (maybe in another class in some other cs file)

3) I would now like to return to where I first stopped (just navigation in the code. Do not confuse with the go back in debugger feature used in VS's intellitrace debugging tool)

Right now I place a bookmark and return to my bookmark. But I forget most of times to place a bookmark. Hence this question. There's got to be a shortcut to get back to current line of execution or stopped at or whatever phrase is used to describe this. I also have Resharper if I can craft up some hotkey or shortcut. Anyway I can get back to where the debugger has "broken". I sometimes also use Ctrl - multiple times to navigate backwards. thank you

Gullu
  • 3,477
  • 7
  • 43
  • 70

2 Answers2

30

That would be the Visual Studio command "Debug.ShowNextStatement" (usually assigned to Alt+Num*). You can also use the Breakpoints Window (Alt+Ctrl+B) to navigate between your breakpoints.

UPDATE: I implemented @Alex 's request for a more discoverable and accessible MenuItem for this functionality, as part of a commercial Visual Studio extension I created called OzCode. It works similarly to Resharper's Context Actions: when you are in break mode but have navigated far away from the 'current statement', this QuickAction will appear:

ShowNextStatement

Omer Raviv
  • 11,409
  • 5
  • 43
  • 82
  • Been looking for this for a while, thanks! Why oh why did they not put this not in the main Debug menu? – Alex Feb 08 '12 at 09:53
16

I tend to use the call stack window, double click the top line in the stack trace causes the editor window to display the code line where execution halted

Phil Thompson
  • 161
  • 1
  • 2