When a thread is suspended, the step controls can be used to step through the execution of the program line-by-line. While performing a step operation, if a breakpoint is encountered, execution suspends at the breakpoint, and the step operation ends.
1. |
Select a stack frame in the Debug view. |
2. |
The current line of execution in that stack frame is highlighted in the editor in the Debug perspective. |
3. |
Click the Step Over button in the Debug view toolbar, or press the F6 key. |
4. |
The currently-selected line is executed and suspends on the next executable line. |
1. |
Select a stack frame in the Debug view. |
2. |
The current line of execution in the selected frame is highlighted in the editor in the Debug perspective. |
3. |
Click the Step Into button in the Debug view toolbar, or press the F5 key. |
4. |
The next expression on the currently-selected line to be executed is invoked, and execution suspends at the next executable line in the method that is invoked. |
1. |
Select a stack frame in the Debug view. |
2. |
The current line of execution in the selected frame is highlighted in the editor in the Debug perspective. |
3. |
Click the Run to Return button in the Debug view toolbar or press the F7 key. |
4. |
Execution resumes until the next return statement in the current method is executed, and execution suspends on the next executable line. |
When a thread is suspended, it is possible to resume execution until a specified line is executed. This is a convenient way to suspend execution at a line without setting a breakpoint.
1. |
Place your cursor on the line to which you want the program to run and select Run to Line from the context menu. |
2. |
Program execution is resumed and suspends just before the specified line is to be executed. |
3. |
It is possible that the line will never be hit and that the program will not suspend. Breakpoints and exceptions cause a thread to suspend before reaching the specified line. |