gcov support for shared library

Neuberger, Daniel [USA] neuberger_daniel@bah.com
Thu Sep 23 19:37:00 GMT 2010


> Ah, thanks for this information.  You can pass --object-directory .libs
> to gcov to help it find the right .gcda files.

Ahh, thanks.  I have actually been using the gcovr python script (https://software.sandia.gov/trac/fast/wiki/gcovr) to produce Cobertura XML output and they don't have that option.  I submitted a ticket for them to expose the gcov -o option though because that would be useful.  I may just right a patch myself sometime soon, but for now, my workaround is good enough.

> I'm wondering how autotools could help make this sort of processing easier or
> more automatic.  That would certainly be something I'd love to see included.

Agreed.  You might want to submit a feature request or maybe I'll do that eventually.  For now, I just added a target that basically runs the gcovr script.  It would be nice if there were a default target though that could easily produce either lcov style HTML or Cobertura style XML or text output.

Thanks.

- Daniel



More information about the Gcc-help mailing list