Must the main() executable program be compiled and linked with gcov options to use gcov on shared library

256 Views Asked by At

Is there a way for gcov to provide coverage analysis of a shared library without building the main() program that uses the shared library?

I have external users of the shared library that have their own executable programs that use the library and I need to test code coverage with those programs but I do not have access to their source code.

Surely somebody else has encountered this problem with gcov.

The main() and the shared library are written in C. For a main() program that I do have source code for I was able to use gcov just fine to get an execution trace of calls placed to the shared library.

I have not seen any examples where gcov is used without compiling and linking the main() program. Never the less I am asking this question with the hope somebody else has found a work around solution.

A similar question has also been posted on gcc-help.

  • Warren Ferguson
0

There are 0 best solutions below