Skip to main content

IAR Embedded Workbench for RL78 5.20

Introduction to using trace

In this section:

See also:

Reasons for using trace

By using trace, you can inspect the program flow up to a specific state, for instance an application crash, and use the trace data to locate the origin of the problem. Trace data can be useful for locating programming errors that have irregular symptoms and occur sporadically.

Briefly about trace

To use trace in C-SPY requires that your target system can generate trace data. Once generated, C-SPY can collect it and you can visualize and analyze the data in various windows and dialog boxes.

Depending on your target system, different types of trace data can be generated.

Trace data is a continuously collected sequence of every executed instruction for a selected portion of the execution.

Trace features in C-SPY

In C-SPY, you can use the trace-related windows—Trace, Function Trace, Timeline, and Find in Trace.

Depending on your C-SPY driver, you:

  • Can set various types of trace breakpoints and triggers to control the collection of trace data.

  • Have access to windows such as the Interrupt Log, Interrupt Log Summary, Data Log, and Data Log Summary.

In addition, several other features in C-SPY also use trace data, features such as Profiling, Code coverage, and Instruction profiling.

Trace in the E1, E2, E2 Lite/E2 On-Board, EZ-CUBE2, and COM Port emulators

The E1, E2, E2 Lite/E2 On-Board, EZ-CUBE2, and COM Port emulators can collect trace data from RL78 devices that support trace. In the emulator, the trace function has a circular frame buffer where the emulator can save frames. When the Go or a step command is executed, the trace function can save information for each executed branch, in the form of OP-fetch addresses and data.

Up to 256 frames can be saved in the trace buffer.

Note

The Next Statement and Run to Cursor commands do not collect any trace data for the E1, E2, E2 Lite/E2 On-Board, EZ-CUBE2 or COM Port emulators. Using these commands will disable trace data collection.