2 Minutes To Code (β Version)

Debugging with Eclipse - 2 minute tutorial

How to set breakpoints in debugger

Before you can start debugging, you need to set breakpoints at some line numbers in the source code.

A breakpoint is essentially a line-number of the code where you want the debugger to suspend execution of the program and hand over the control to you to analyze the value of different fields in you class. After a breakpoint is hit, you can then ask debugger to step through the code one line at a time and analyze the flow that the program takes, teh values of variables etc.

To set a breakpoint, click on the left-hand margin of the source code window at the line-number that you want to set the breakpoint at and click Toggle Breakpoint as shown in the image below. To remove breakpoint, hit Toggle Breakpoint once again.

In teh next page, we will see how to customize a breakpoint and create conditional breakpoint.