Skip to main content

IAR Embedded Workbench for Arm 9.70.x

Setting breakpoints using system macros

In this section:

You can set breakpoints not only in the breakpoint dialog box, but also by using built-in C-SPY system macros. When you use system macros for setting breakpoints, the breakpoint characteristics are specified as macro parameters.

Macros are useful when you have already specified your breakpoints so that they fully meet your requirements. You can define your breakpoints in a macro file, using built-in system macros, and execute the file at C-SPY startup. The breakpoints will then be set automatically each time you start C-SPY. Another advantage is that the debug session will be documented, and that several engineers involved in the development project can share the macro files.

Note

If you use system macros for setting breakpoints, you can still view and modify them in the Breakpoints window. In contrast to using the dialog box for defining breakpoints, all breakpoints that are defined using system macros are removed when you exit the debug session.

C-SPY macro for breakpoints

Simulator

I-jet

J-Link/J-Trace

CMSIS-DAP

CADI

E2

__setCodeBreak

Yes

Yes

Yes

Yes

Yes

Yes

__setDataBreak

Yes

Yes

Yes

__setLogBreak

Yes

Yes

Yes

Yes

Yes

__setDataLogBreak

Yes1

Yes

__setSimBreak

Yes1

__setTraceStartBreak

Yes1

Yes

__setTraceStopBreak

Yes1

Yes

__clearBreak

Yes1

Yes

Yes

Yes

Yes

Yes

Table 21. C-SPY macros for breakpoints 


1. Not for all cores and devices.

C-SPY macro for breakpoints

GDB Server

ST-LINK and TI MSP-FET

PE micro

TI Stellaris /

TI XDS

Nu-Link

G+Link

__setCodeBreak

Yes

Yes

Yes

Yes

Yes

Yes

__setDataBreak

Yes

__setLogBreak

Yes

Yes

Yes

Yes

Yes

Yes

__setDataLogBreak

__setSimBreak

__setTraceStartBreak

__setTraceStopBreak

__clearBreak

Yes

Yes

Yes

Yes

Yes

Yes

Table 22. C-SPY macros for breakpoints 


For information about each breakpoint macro, see Reference information on C-SPY system macros.

Setting breakpoints at C-SPY startup using a setup macro file

You can use a setup macro file to define breakpoints at C-SPY startup. Follow the procedure described in Using C-SPY macros.