3.6.1 Breakpoints

Breakpoints are an essential part of any debug mechanism. CADI offers several types of breakpoints that target different areas and levels of debugging. Each breakpoint can be individually configured to modify its behavior.

Predefined breakpoint types

CADI provides predefined breakpoint types.

Program breakpoints
Program breakpoints are breakpoints set in a program memory of the target. As soon as the program counter equals hits the corresponding address, the simulation suspends and awaits additional commands from the caller.
Memory breakpoints
A memory breakpoint can be set to a specific address in the available memory. This breakpoint suspends simulation if the specified address is read or written, or the value changes.
Register breakpoints
Setting a register breakpoint to a specific register results in a suspended simulation if the register is read or written, or its value changes.
Instruction step breakpoints
The instruction step breakpoint is an inverted program breakpoint. It suspends simulation as soon as the program counter is set to an address different from the selected breakpoint address. As indicated by its name, this type of breakpoint is used for instruction step implementations. The breakpoint can be set to the current value of the program counter.
Program range breakpoints
This breakpoint type extends the program breakpoint to check a specific range of program addresses instead of a single one.
Exception breakpoints
An exception breakpoint is triggered immediately after the occurrence of an exception.

The breakpoint types supported by a target component are stored in a vector that contains the features for the target (CADITargetFeatures_t). CADI provides comparison values to identify supported predefined types. These are named CADI_TARGET_FEATURE_BPT_TypeExtension. To determine support, perform a simple bitwise AND operation on the target features and the comparison value.


Do not confuse these enum data types:

  • CADI_BPT_TypeExtension represents an index of the breakpoint type.
  • CADI_TARGET_FEATURE_BPT_TypeExtension represents a breakpoint type vector for comparison with the CADI target features.

For both enum data types, TypeExtension is one of these:


Breakpoint properties

CADIBptRequest_t owns several fields specific to certain breakpoint types. These fields are ignored for other types.

This sections gives an overview of the respective associations between fields in CADIBptRequest_t and the various breakpoint types.

Table 3-1 Properties for each breakpoint by trigger type

triggerType Program Memory Register Instruction Step Program Range Exception
Address Yes Yes - Yes Yes Yes
sizeOfAddressRange - - - - Yes -
Enabled Yes Yes Yes Yes Yes Yes
Conditions Yesa Yesa Yesa Yesa Yesa Yesa
useFormalConditions Yes Yes Yes Yes Yes Yes
formalCondition Yesb Yesb Yesb Yesb Yesb Yesb
type Yes Yes Yes Yes Yes Yes
regNumber - - Yes - - -
temporary Yes Yes Yes Yes Yes Yes
continueExecution Yes Yes Yes Yes Yes Yes

If a field is not supported for the required breakpoint type, its value must be left to the initial value assigned by the standard constructor of CADIBptRequest_t.

Breakpoint configuration

CADI provides the dedicated data structure CADIBptRequest_t that is used to set a breakpoint requested by the caller. It holds a description of the breakpoint and specifies its details.

These details include:

  • Its type.
  • The location (memory address or register number) it is to be set to.
  • A possible condition for the breakpoint.

A breakpoint can be defined as enabled or as disabled and the state can be changed by a corresponding method call. Breakpoints can be configured to continue execution after being hit.

A breakpoint can be declared as temporary. Temporary breakpoints can be easily cleared by calling CADIBptClear() with a special breakpoint ID (CADI_BPT_CLEAR_ALL_TEMPORARY_BPTS). This removes all of the breakpoints that have the temporary field has set in CADIBptRequest_t.

It is not required to set every field of the corresponding data structure for a breakpoint. Properties that are not required for a certain breakpoint type are ignored by the target. For example, the triggerType field of CADIBptRequest_t is only used for setting a register breakpoint or a memory breakpoint.

Configuring conditional breakpoints requires special planning. There are two options, either:

  • Use the format set of conditions provided by CADI that cover typical conditions.
  • Forward the breakpoint to the target which then decides if custom conditions apply.

Using formal conditions requires that the corresponding data object owned by CADIBptRequest_t is set. This member, of type CADIBptCondition_t, includes the condition operator and a value to apply the operator to. The format of this value is described by the operator, for example whether it is a signed or unsigned value, and by the bitwidth specified in the condition data type. The bitwidth includes the sign bit.

Breakpoint management

To set a new breakpoint, call CADIBptSet(). It receives a breakpoint description of type CADIBptRequest_t. On return, the caller receives a breakpoint ID of type CADIBptNumber_t to use in subsequent breakpoint management calls.

After creating a new breakpoint/watchpoint with CADIBptSet(), the breakpoint/watchpoint is enabled/disabled depending on the value of the Enabled field.

Use CADIBptConfigure() to change the enable state for a breakpoint. Call CADIBptClear() to clear a breakpoint. After clearing a breakpoint, the corresponding breakpoint number must not be referred to.


There are two breakpoint IDs that must not be used:
  • 0 represents an invalid breakpoint ID.
  • 0xFFFFFFFF is reserved for clearing temporary breakpoints.

To read out descriptions of currently set breakpoints either:

  • Use CADIBptRead() to request the description of a single breakpoint.

    The breakpoint number must be available to identify the required breakpoint.

  • Use CADIBptGetList() to request a list of breakpoints set in the target.

    The method can be used, for example, to read out all breakpoint information of an existent simulation the caller is connected to. No specific knowledge about the target is required.

The CADIBptGetList() method call scheme is that used by CADI accesses from a debugger. To create a buffer with an appropriate size, either:

  • Make a reasonable estimate of the number of breakpoints required.
  • Use the number of supported breakpoints specified in the target features (nrBreakpointsAvailable).

    Depending on the target implementation, this number might be very large.

An important use case for CADIBptGetList() is breakpoint synchronization of several connected callers. This debugger can regularly update the breakpoint list and show breakpoints that have been set from another tool.


Yes only if useFormalConditions is 0.


Yes only if useFormalConditions is 1.

Non-ConfidentialPDF file icon PDF version100963_0200_03_en
Copyright © 2014–2018 Arm Limited or its affiliates. All rights reserved.