Skip to main content

IAR Embedded Workbench for RH850 3.20.x

Breakpoint types

In this section:

Depending on the C-SPY driver you are using, C-SPY supports different types of breakpoints.

Code breakpoints

Code breakpoints are used for code locations to investigate whether your program logic is correct or to get trace printouts. Code breakpoints are triggered when an instruction is fetched from the specified location. If you have set the breakpoint on a specific machine instruction, the breakpoint will be triggered and the execution will stop, before the instruction is executed.

Log breakpoints

Log breakpoints provide a convenient way to add trace printouts without having to add any code to your application source code. Log breakpoints are triggered when an instruction is fetched from the specified location. If you have set the breakpoint on a specific machine instruction, the breakpoint will be triggered and the execution will temporarily stop and print the specified message in the C-SPY Debug Log window.

Trace Start/Stop Trigger breakpoints

Trace Start Trigger and Trace Stop Trigger breakpoints start and stop trace data collection—a convenient way to analyze instructions between two execution points.

Timer Start and Stop breakpoints

Timer Start and Stop breakpoints set up a timer—a convenient way to measure the time on target hardware between two execution points. The executed time is displayed in the Debug Log window.

Data breakpoints

Data breakpoints are primarily useful for variables that have a fixed address in memory. If you set a breakpoint on an accessible local variable, the breakpoint is set on the corresponding memory location. The validity of this location is only guaranteed for small parts of the code. Data breakpoints are triggered when data is accessed at the specified location.

The execution will usually stop directly after the instruction that accessed the data has been executed.

Data Log breakpoints

Data log breakpoints are triggered when a specified variable is accessed. A log entry is written in the Data Log window for each access. Data logs can also be displayed on the Data Log graph in the Timeline window, if that window is enabled.

You can set data log breakpoints using the Breakpoints window, the Memory window, and the editor window.

Using a single instruction, the microcontroller can only access values that are four bytes or less. If you specify a data log breakpoint on a memory location that cannot be accessed by one instruction, for example a double or a too large area in the Memory window, the result might not be what you intended.

Performance analysis breakpoints

By default, if you enable performance analysis, it runs during the entire execution. Performance Start and Stop breakpoints are used for analyzing the performance over a smaller region of code. For reference information about these breakpoints, see Analyzing code performance.

Performance Start and Stop breakpoints share the same resources as hardware code breakpoints, see Breakpoints in the C-SPY hardware debugger drivers.Breakpoints in the C-SPY hardware debugger drivers

Immediate breakpoints

The C-SPY simulator lets you set immediate breakpoints, which will halt instruction execution only temporarily. This allows a C-SPY macro function to be called when the simulated processor is about to read data from a location or immediately after it has written data. Instruction execution will resume after the action.

This type of breakpoint is useful for simulating memory-mapped devices of various kinds (for instance serial ports and timers). When the simulated processor reads from a memory-mapped location, a C-SPY macro function can intervene and supply appropriate data. Conversely, when the simulated processor writes to a memory-mapped location, a C-SPY macro function can act on the value that was written.