Skip to main content

IAR Embedded Workbench for RX 5.20

Introduction to code coverage

In this section:

Reasons for using code coverage

The code coverage functionality is useful when you design your test procedure to verify whether all parts of the code have been executed. It also helps you identify parts of your code that are not reachable.

Briefly about code coverage

The Code Coverage window reports the status of the current code coverage analysis for C or C++ code. For every program, module, and function, the analysis shows the percentage of code that has been executed since code coverage was turned on up to the point where the application has stopped. In addition, all statements that have not been executed are listed. The analysis will continue until turned off.

Note

Assembler code is not covered in the Code Coverage window. To view code coverage for assembler code, use the Disassembly window.

Requirements and restrictions for using code coverage

Code coverage is supported by the C-SPY simulator and there are no specific requirements or restrictions.

When using use code coverage in a hardware debugger system, be aware of the limitations. Code coverage information is based on trace data. Trace data for the E1, E2, E2 Lite, and EZ-CUBE2 emulators and the J-Link debug probe is very limited. If you are using an E1, E2, E2 Lite, or EZ-CUBE2 emulator or a J-Link debug probe, PC sampling provides better data than any other source. but code coverage will not be complete regardless of the source. Code that has been executed might not be shown as such.