How to do code coverage on embedded

前端 未结 3 1174
你的背包
你的背包 2021-02-06 08:58

I write a project for a non POSIX embedded system so I cannot use gcc option --coverage (i don\'t have read or write). What else can I do to produce gcov like output. I do have

3条回答
  •  长情又很酷
    2021-02-06 09:54

    Disclaimer: The company (Rapita Systems) I work for provides a code coverage solution aimed at embedded applications.

    Because embedded systems bring their own, special and widely varying requirements, the "best" solution for code coverage also varies widely.

    • Where you have trace-based devices, like ARM chips with ETM or NEXUS-enabled parts, you can perform coverage without instrumentation via debuggers.
    • Otherwise, you are most likely faced with an instrumentation-based solution:
      • For RAM-limited solutions, a good solution is to write instrumentation to an I/O port
      • Alternatively, you can record instrumentation to a RAM buffer, and use a wide variety of means to extract this from the target.

    Of course lots of different flavours of code coverage are also available: function, statement, decision/branch, MC/DC

提交回复
热议问题