Debugging a project

To debug a project:

  1. Set the debug configuration for your project.
    1. Select the project in the Project Explorer view.
    2. Open the debug configuration in any of these ways:
      • Right-click the project and select Debug as > Debug Configurations… from the context menu.
      • Choose Run > Debug Configurations… from the menu bar.
      • Click an arrow next to Debug picture on the toolbar and select Debug Configurations….
    3. In the Debug Configurations dialog box, select the required debug configuration. The name of the debug configuration is composed of the project name, debugging interface and build configuration. The configuration settings appear on the tabs.

      Debug Configurations dialog box

    4. Modify the configuration settings where required and click Apply to save the changes.
  2. Click Debug. The debugger downloads the program to the memory of the target processor. The Debug perspective is displayed. The execution halts at the first statement of the main() function. The program counter icon on the marker bar points the next statement to be executed.

    Debug perspective

  3. To set and run to a breakpoint:
    1. Double-click on the marker bar next to a statement. The breakpoint indicator (blue dot) appears next to the statement.
    2. From the Debug view, select Run > Resume on the menu bar. The debugger executes all statements up to (but not including) the breakpoint statement.
  4. To control the program:
    1. From the Debug view, select Run > Step Over from the menu bar. The debugger executes the breakpoint statement and halts at the next statement.
    2. From the Debug view, select Run > Resume from the menu bar. The debugger resumes the program execution.
    3. From the Debug view, select Run > Terminate. The debug session ends.