views:

75

answers:

5

Let's say I have

int a()
{
/* Tons of code
....*/
return someInt;
}

void main()
{
/* Tons of code
....*/

int k = a();

/* Tons of code
....*/
}

Next, lets pretend that I'm debugging one step at a time and about to go into the

int k = a();

statement but that I just want it executed without stepping through a() manually. Is there something I can do instead of F11 so it executes until the next statement in the method.

Right now I set a breakpoint after the call to a(), but I'm thinking there may be a better way.

+8  A: 

Is it as simple as Step Over?

StarShip3000
I thought step over wouldn't execute the line, just step over it. I want the call to a() to be executed, just not step into it-- I guess I should just try it.
Matt
Step Over does exactly what you want.
JSBangs
+5  A: 

Yeah, use F10, "step over."

BobbyShaftoe
+2  A: 

Yep, press F10 to step over the statement.

romkyns
+2  A: 

F10 to step over, or, if you have already stepped into a method, you can use Shift+F11 to step out of it.

Iceman
+2  A: 

StepOver is definitely what you want but I have a tip for you:

If you never want to step into a method (or class / struct etc) you can apply the DebuggerStepThroughAttribute to it and the debugger will always step over it unless you've explicitly put a breakpoint inside.

For properties, you have put put the attribute on the get / set accessors.

In your example:

[DebuggerStepThrough]
int a()
{
/* Tons of code
....*/
return someInt;
}

void main()
{
/* Tons of code
....*/

int k = a();

/* Tons of code
....*/
}
TrickyFishy