Skip to main content

IAR Embedded Workbench for RH850 3.20.x

__setCodeBreak

In this section:
Syntax

For the C-SPY Simulator:

__setCodeBreak(location, count, condition, cond_type, action)

For the hardware debugger drivers:

__setCodeBreak(location, count, condition, cond_type, action, implementation)
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.

implementation

This parameter is only for use with the hardware debugger drivers. It is a string that specifies the breakpoint implementation; either "HW" (hardware breakpoint) or "SW" (software breakpoint).

Return value

Result

Value

Successful

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

Unsuccessful

0

Table 38. __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()", "SW");

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

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

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", "", "HW");
See also

Breakpoints.