: Set a breakpoint at the
A breakpoint is a flag in the source code that tells the debugger where to stop execution of theprogram. When your program stops on a breakpoint, you can perform actions like examining thevalue of variables and single-stepping through your program.To set a breakpoint, Click in the left margin next to the line in the source code or put the insertionpoint in the line and press Ctrl-F8.
: Run the debugger by pressing Ctrl-F5
: Step through your programOnce execution of your program is halted, you can step through your lines of code using thefollowing commands on the Debug menu or toolbar:
Step Over (F8).
Executes one source line. If the source line contains a call, executes theentire routine without stepping through the individual instructions.
Step Over Expression (Shift-F8).
Executes one method call in an expression. If an expressionhas multiple method calls, you can use Step Over Expression to step through an expressionand view the value of each method call in the expression in the Local Variables window. Eachtime you use the Step Over Expression command, the debugger advances to the nextmethod call in the expression and the completed method call is underlined. Step OverExpression behaves like Step Over when there are no additional method calls.
Step Into (F7).
Executes one source line. If the source line contains a call, the IDE stops justbefore executing the first statement of the routine. You can also start a debugging sessionwith the Step Into command. Program execution stops on the first line after the
routinebefore any changes have been made to the state of the program.
Step Out (Ctrl-F7).
Executes one source line. If the source line is part of a routine, executesthe remaining lines of the routine and returns control to the caller of the routine. Thecompleted method call is highlighted in the Source Editor.