Skip to main content

IAR Embedded Workbench for RX 5.20

__setCodeBreak

In this section:
Syntax
__setCodeBreak(location, count, condition, cond_type, action)
Parameters
location

A string that defines the code location of the breakpoint, either a valid C-SPY expression whose value evaluates to a valid address, an absolute location, or a source location. For more information about the location types, see Enter Location dialog box.

count

An integer that specifies the number of times that a breakpoint condition must be fulfilled before a break occurs the next time.

condition

The breakpoint condition. This must be a valid C-SPY expression, for instance a C-SPY macro function.

cond_type

The condition type; either "CHANGED" or "TRUE" (string).

action

An expression, typically a call to a macro, which is evaluated when the breakpoint is detected.

Return value

Result

Value

Successful

An unsigned integer uniquely identifying the breakpoint. This value must be used to clear the breakpoint.

Unsuccessful

0

Table 41. __setCodeBreak return values 


For use with

All C-SPY drivers.

Description

Sets a code breakpoint, that is, a breakpoint which is triggered just before the processor fetches an instruction at the specified location.

Example
__setCodeBreak("{D:\\src\\prog.c}.12.9", 3, "d>16", "TRUE", "ActionCode()");

This example sets a code breakpoint on the label main in your source:

__setCodeBreak("main", 0, "1", "TRUE", "");

This example sets the breakpoint within a specific source file and line without using the absolute file path to the source:

__setCodeBreak("{main.c}.288.7", 0, "1", "TRUE", "");
See also

Breakpoints.