Use of gcov with shared libraries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I'm having a hard time making gcov work with a shared library. The issue is that the .gcda file for the module of interest (which is part of the shared lib) is not being generated after the run. The logic that I follow is roughly this:

- the main binary is built with -fprofile-arcs -ftest-coverage flags (both in compile & link)
- the shared library is built with the same flags (both in the compile of the module of interest & link)

Please have in mind that build & run take place in different machines, but I have taken care so that the paths are the same (after spending quite a while to figure this out I must admit). Moreover, the main binary and the library reside in different directories.

Also, note that I created a test scenario that looks like the above but a bit simpler: I created a trivial shared lib and a trivial binary that makes use of the lib. I have created instrumented binaries for both with the above flags and separated them into different directories. After the run, .gcda files where created successfully both in the main binary & in the lib directory. 

So the main difference between the two scenarios is that the first is more complicated with a dozen of additional compile flags. The other grand difference is the first does not work :-)

Any ideas, what might be the problem?

Thanks a lot,
Antonis


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux