views:

282

answers:

6

What key do I use to step into a method in VS2008 debug mode?

If I have a method call like this:

string s = StepIntoThisMethod(DoNotStepIntoThisOne(i), NotIntoThisEither(j));

If I use F11, I step into the methods in the argument list. I would like to step into StepIntoThisMethod method

+7  A: 

Well, that's a little tricky I think...

in your example I do: F11, shift-F11 (does first arg in 2 keystrokes), F11, shift-F11 (second arg), then F11

not pretty but works.

John Weldon
This is the most appropriate answer. Using DebuggerStepThrough for this is like napalming your house just to kill a spider.
Steve M
Napalming your house to kill a spider! Awsome!!That's a bit like cutting off your nose to spite your face.
Noel Kennedy
+2  A: 

There is no way to do this in the VS.Net debugger. By that I mean there is no key sequence to achieve "step into only this method".

If you want to always avoid DoNetStepIntoThisOne you can add the DebuggerStepThroughAttribute onto the method. Then unless you actually set a break point in the method, VS will not step into the method.

[DebuggerStepThrough]
public void DoNotStepIntoThisOne(...)
JaredPar
+1  A: 

Hit Shift+F11 to jump back out of the argument methods. You'll have to do it twice to get out of NotIntoThisEither, but the third F11 should get you into StepIntoThisMethod.

Chris Doggett
+1  A: 

Use the DebuggerStepThroughAttribute on both methods.

Daniel Brückner
+1  A: 

There's no key combination or command to pull this off.

You can jump in and out until you reach the method, but that's a huge hassle.

I usually just right-click, go to definition, insert a breakpoint on the function declaration, and run.

Strilanc
This is generally my approach too.
chyne
+2  A: 

In my Visual Studio 2008 that shortcut is called StepIntoSpecific and is bound to Shift+Alt+F11.

Pay also attention to the link1 and link2 (chapter 3)

Vadmyst
My God! Thank you for that pointer - I never knew about it, and it's even in the right button context menu. Cripes!
Michael Burr
How do you bind it to Shift+Alt+F11?
DotnetDude
Using the keyboard configuration panel in the Tools/Options dialog. For me it was mapped there by default, but obviously that might depend on whatever mapping you selected when VS was installed.
Michael Burr
I just noticed that I when the debugger hits the breakpoint and i right click, I do not see the StepIntoSpecific. Am I missing something obvious? I do have 2008
DotnetDude
This might be a C/C++ thing only - that's what I tested. Maybe it doesn't work for .NET (I dunno, and if not I don't know why that would be te case).
Michael Burr