Breakpoints
A breakpoint is a debugging tool that allows you to pause the execution of your program. There are two types of breakpoints that can be set.
- Line Break
- Method Break
After creating the breakpoints, click on Run>Debug to start debugging your code. You will notice that the execution is paused as soon as the first breakpoint is encountered. At any point in time you can choose to resume the execution by pressing the resume button.
Line Break
Line breaks can be set in Eclipse by double clicking on a specific line in the very left side of the code window. This will create a blue dot.
A line break will pause the execution of your program when that specific line of code would be executed next.
Method Break
A method break is a line break except that it is created on a line that defines a method. Method breaks will pause execution every time that specific method is called.
Breakpoint Window
Eclipse manages all breakpoints in the "Breakpoints" window that is part of the debugging perspective. You can view all breakpoints that have been set in a program in this window. This window will also allow you to toggle on/off specific/all breakpoints, as well as add and remove breakpoints.