Stephen Todd
Stephen Todd

Reputation: 375

Visual Studio debug, jump to end of method, or to calling method

I fairly often get to a state in VS (C#) debug breakpoint or exception where I want to exit out of several levels of method to a caller a few levels up the stack. I can then patch up/retry/etc.

In simple cases I can [1] find the end of the current method, [2] set next statement, and [3] step out. Then repeat 1/2/3 working my way up the calling stack till I get where I want to be. However, this is a decided pain ....

Can anyone suggest any automation to help this? In order of preference ....

  1. jump all the way out to where I want to be in one go
  2. combine 1/2/3 in a single shortcut I can quickly repeat
  3. just automate step 1 (steps 2 and 3 are easy with standard shortcuts).

(I've tried searching, but all the terms I can think of are so generic that I haven't got any useful answers).

Upvotes: 5

Views: 3759

Answers (2)

Charles Lambert
Charles Lambert

Reputation: 5132

The debugger does not have a way to set the next statement to execute somewhere other than the current method at the top of the stack.

Upvotes: 2

Kent
Kent

Reputation: 1036

Shift-F11 steps out of current method.

Upvotes: 8

Related Questions