Udostępnij za pośrednictwem


Code Stepping Overview

This topic applies to:

Edition

Visual Basic

C#

F#

C++

Web Developer

Express

Topic applies Topic applies Topic applies Topic applies Topic applies

Pro, Premium, and Ultimate

Topic applies Topic applies Topic applies

Topic applies

Topic applies

One of the most common debugging procedures is stepping. Stepping is executing code one line at a time.

The Debug menu provides three commands for stepping through code:

  • Step Into

  • Step Over

  • Step Out

Step Into and Step Over differ in only one respect, the way they handle function calls. Either command instructs the debugger to execute the next line of code. If the line contains a function call, Step Into executes only the call itself, then halts at the first line of code inside the function. Step Over executes the entire function, then halts at the first line outside the function. Use Step Into if you want to look inside the function call. Use Step Over if you want to avoid stepping into functions.

On a nested function call, Step Into steps into the most deeply nested function. If you use Step Into on a call like Func1(Func2()), the debugger steps into the function Func2.

If you want to step into a specific nested function, use the Step Into Specific command from the shortcut menu. For more information, see How to: Step Into a Specific Function.

Use Step Out when you are inside a function call and want to return to the calling function. Step Out resumes execution of your code until the function returns, then breaks at the return point in the calling function.

See Also

Concepts

Execution Control