3

I'm currently facing an issue with generating .gcda files for coverage data of a static library. I can get coverage data for most files, but not all.

I'll refer to the object file with the missing coverage data as X.

Some things to note:

  • I have compiled the library and test executable with the appropriate flags.
  • The .gcno files are generated for all objects, including X.
  • The .gcda files are generated for MOST objects, excepting X.
  • The symbol dump of X's object file has the gcov symbols present in its disassembly.

When running a test that uses X, .gcda files are generated for other files, just not X.

What could be happening that prevents a single .gcda file from being generated?

-

Operating System: OS X 10.12

LLVM Compiler Version: 8.0.0

  • Is the object X linked with the gcov library? Also the *.gcda files for the sources of library X would be generated in the path where the library X was build from source. – AmeyaVS Jun 07 '17 at 02:48
  • Yes. .gcda files are being generated for all objects but a few. They are all linked and built with the appropriate flags as shown in the xcodebuild output. – forrest.gump Jun 07 '17 at 04:08

2 Answers2

1

It appears that the issue was including the suspect files in both the test project and the library project. The .gcda files were found in the test's intermediate files, but were absent from the library's intermediate files.

Strange issue, and also difficult to debug.

0

I think you might need your kernel enable for gcov.
Enable CONFIG_DEBUG_FS, CONFIG_GCOV_KERNEL, CONFIG_GCOV_FORMAT_AUTODETECT and CONFIG_GCOV_PROFILE_ALL

and the gcda file for static lib will be under /sys/kernel/debug/gcov/

mJace
  • 49
  • 1
  • 8