Using breakpoints

A breakpoint can be set on an executable line of a program. If the breakpoint is enabled when you debug, the execution suspends before that line of code executes. Once execution halts, you can examine your program's current state and check register and variable values. You can also change these values and alter the flow of normal program execution.

To set a breakpoint:
  1. In the Editor area, open the file where you want to add the breakpoint.
  2. Directly to the left of the line where you want to add the breakpoint, right-click the marker bar (vertical ruler) and select Toggle Breakpoint. You can also double-click on the marker bar next to the source code line. A new breakpoint marker appears on the marker bar, directly to the left of the line where you added the breakpoint.
    Note: The "No source file named..." warning appears in Debugger Console when you set breakpoints for functions with the same name in different projects. This is a known issue of Eclipse. This issue has no impact on the debug session and can be ignored.
    The following table defines types of breakpoints.
    Table 1. Breakpoint types
    Type of breakpoint Description Enabled State Disabled State
    Regular

    Regular breakpoint can be hardware or software.

    There is restriction on the number of hardware breakpoints in a project.

    Software breakpoints are implemented by replacing some code in the target with special opcodes. These opcodes stop the core as soon as they are executed. Software breakpoints only work if the code is running out of RAM. There is no restriction on the number of software breakpoints in a project.

    A dot icon is displayed in the marker bar and in the Breakpoints view, along with the name of the associated file.

    breakpoint breakpoint
    Hardware Hardware breakpoints are implemented by the processor hardware. The number of hardware breakpoints available varies by processor type Hardware breakpoint Hardware breakpoint
    Temporary Breakpoint halts the program execution and then removes the breakpoint that caused the halt. breakpoint breakpoint
    Hardware Temporary Hardware breakpoint, halts the program execution and then removes the breakpoint Hardware breakpoint Hardware breakpoint

    Breakpoints have enabled and disabled states. The following table defines these states.

    Table 2. Breakpoint states
    State Description
    Enabled Indicates that the breakpoint is currently enabled. The debugger halts the program execution at an enabled breakpoint, the execution suspends before that line of code executes. Click the icon to disable the breakpoint
    Disabled Indicates that the breakpoint is currently disabled. The debugger does not halt program execution at a disabled breakpoint. Click the icon to enable the breakpoint