You can use the Visual Studio 2008 debugger to set breakpoints that stop running the code at that point. You can then step through the code and also step into function calls for which debugging information is available. You can set breakpoints before the code runs or while the code is running. When you set a breakpoint, the debugger breaks the next time that line of code runs.

In Visual Studio 2008, you can set a breakpoint in two ways. One way is to right-click the line of code on which the breakpoint should be set, select Breakpoint, and then click Insert Breakpoint. Another way to add a breakpoint is to insert a caret (^) in the code window on the line of code on which the breakpoint should be set, click the Debug menu and, click New Breakpoint.

You can remove a breakpoint by right-clicking the line of code that contains the breakpoint to be removed and then clicking Remove Breakpoint. You can remove all breakpoints at one time by clicking Debug, and then clicking Delete All Breakpoints.

The particular line of code that breaks the debugger has not yet been run. At this point, you can use the following commands on the Debug menu to navigate through the code:

  • Step Over steps to the next executable line of code.

  • Step Into steps into the function at the executable line of code, if possible. If no debugging information is available for the current function, the Step Into command steps to the next executable line of code.

  • Step Out steps out of the current function and back into the point from which the current function was called.

For more information about breakpoints, see Breakpoints in the Visual Studio 2008 documentation.

See Also

[an error occurred while processing this directive]