gcov not generating gcda files

后端 未结 3 633
挽巷
挽巷 2020-12-19 10:34

I tried to run gcov with -fprofile-arcs & -ftest-coverage and nothing for linking.

It was giving this error:-

 hidden          


        
相关标签:
3条回答
  • 2020-12-19 11:04

    I just found out, if i send a sig kill or sig term to my program, ONLY GCNO FILES ARE MADE, no gcda files.

    0 讨论(0)
  • 2020-12-19 11:14

    Compile with -fprofile-arcs and -ftest-coverage. Link with -lgcov during the generation of shared object. It will work.

    Also you may use --coverage option as synonym for all three steps

    Look at: gcc instrumentation options for more information

    0 讨论(0)
  • 2020-12-19 11:22

    After considering the compilation flag, as mentioned above by crazy_prog, check the "path". While taking the coverage using lcov/gcov, path plays an important role.

    Therefore, the path at which you have created the binary (full path string), and the path at which you are running the binary should be exactly the same.

    For my purpose, since the creation of the binary and execution of the binary is at different places (one in development environment and other in actual board), so using the softlink/shortcuts, I create similar path, and hence run the executable. Finally, one can generate the report in development environment (usually, since the actual platform on board might not have lcov tools support).

    0 讨论(0)
提交回复
热议问题