Skip to content

Define the breakpoints

This section requires the embedXcode+ edition and a board with a built-in or with an optional external hardware debugger.

Breakpoints are defined within the standard Xcode interface.

Multiple options are possible including conditional breakpoints and associated actions.

Add and remove a breakpoint

To add a breakpoint,

  • Click once on the line number.

A dark blue arrow appears over the line number and the breakpoint is defined and enabled.

To disable a breakpoint,

  • Click again on the line number.

The arrow turns light blue and the breakpoint is disabled.

To remove a breakpoint,

  • Click again on the arrow and move it outside till a cloud appears. Then release the button; the breakpoint is removed.

To disable all breakpoints,

  • Show the debug area

  • Click on the blue arrow

The arrow turns grey.

Edit a breakpoint

To edit the breakpoint,

  • Left-click on the line number and choose Edit Breakpoint on the menu.

A window shows all the options for the breakpoint.

Define a conditional breakpoint

The breakpoints can stop the program only when conditions are met.

To ignore the breakpoint a certain number of times before stopping,

  • Set a value on the field Ignore … times before stopping.

In this example, the breakpoint is ignored 4 times before stopping.

To set a condition for the breakpoint,

  • Enter a logical expression on the Condition field. The breakpoint stops only if the value of the logical expression is true.

Here, the breakpoint stops only if the (i%2) condition is met.

It is possible to combine the both kinds of conditions for the LaunchPad boards.

This option is available with using the Ozone application.

However, the debugger for chipKIT boards only allows ignoring the breakpoint a certain number of times, but not setting a condition for the breakpoint.

Associate an action to a breakpoint

A breakpoint can perform actions on the LaunchPad boards.

  • Select Debugger Command as type of action.

  • Type the command in.

printf "i = %d\n",i

Here, the command prints the value of i as i = 2.

Multiple actions can be performed.

  • Click on the + sign located on the right of action and proceed as for the first command.

Here, the debugger prints the value of i as i = 2 as before and displays the message Blink.

Actions and conditions can be used together.

If Automatically continue after evaluating is checked, the action is performed but the program doesn’t stop.

With the Ozone application, this option is available but only prints the message entered, without the value of the variables.

The debugger for chipKIT boards doesn’t support associating an action to a breakpoint.