Single Stepping
Like most debuggers, the one provided by the Eclipse IDE lets you step line by line through your program with one of two commands:
step into (
; F5; or Run → Step Into) and
step over (
; F6; or Run → Step Over). The difference between the two is apparent when the current line is a method call. If you step into the current line, the debugger will go to the first line of the method. If you step over the current line, the debugger will run the method and stop on the next line.
Try stepping now, by running until your breakpoint is hit and then pressing F6 several times in a row. Watch the highlight bar move around as the current line changes.
If you step into a method call and then change your mind, execute the
step return command (
; F7; or Run → Step Return). This lets the program run until the current method returns. The debugger will stop at the line following the line that called the method.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access