Gcc - How to run gcov on test application with Nuttx OS on STM discovery board

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

Setup: Toolchain: gcc-arm-none-eabi-5_2-2015q4-20151219 Target: STM429i-disco board

I want to run gcov and get real time report generated in target as per below link: https://mcuoneclipse.com/2014/12/26/code-coverage-for-embedded-target-with-eclipse-gcc-and-gcov/ https://mcuoneclipse.com/2014/12/26/code-coverage-for-embedded-target-with-eclipse-gcc-and-gcov/

First, sucessfully have compiled my code (POSIX compliant NUTTX OS) with -fprofile-arcs & -ftest-coverage flags & got generated the .gcno files for my src files.

second, sucesfully have linked with -fprofile-arcs flags enabled and using the libgcov.a file (part of the toolchain) and the final binary is generated.

Now, I dont know what changes are needed in my test application to invoke gcov, generate report & dump report.

Another problem is, gcov functions are with HIDDEN attribute in libgcov.a as below.
9: 00000000 4 FUNC GLOBAL HIDDEN 1 __gcov_flush
9: 00000000 4 FUNC GLOBAL HIDDEN 1 __gcov_init

so, I could not invoke as I need.

Any inputs in getting the .gcda file generated would be of great help.

Answers

Can you look for gcov_exit instead? It is similar to __gcov_flush. Typically, it s one of gcov_exit and __gcov_flush that would be there and you can use any.

https://github.com/reeteshranjan/libgcov-embedded https://github.com/reeteshranjan/libgcov-embedded

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/37876030/how-to-run-gcov-on-test-application-with-nuttx-os-on-stm-discovery-board

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils