Background:
I am already getting coverage results via the built in GCC instrumentation of my C++ code, but I want to report some extra (non-C++) code as covered. (Basically config files.) I think I’ve figured out how to collect the raw data (which is not the point of this question) but getting that forwarded to the coverage report I’m already generating is turning into a problem. In theory I could wire something up to dump out a second coverage file along side the existing coverage.dat
, but the plumbing from there on out would be greatly simplified (as in it would just work without any changes) if I can get the results to be dumped in with the coverage GCC generates. Some digging suggests to me that if I can arrange to populate a gcov_info
struct and pass it to a __gcov_init
call, I should get what I want.
However, that type and the protptype for that function are defined in libgcov.h
where as the API’s I know are intended for public use (e.g. __gcov_reset
, __gcov_dump
, etc.) are in gcov.h
. Furthermore, I’m drawing a blank when I search for documentation of that API or even how to get the first header (I’m not even finding it in the GCC source package) but the second one is already installed and I don’t think I ever did anything specific to get it.
My Question:
Am I being unreasonable in expecting to be able to write a library that calls into those API’s? Are they even a public API or just an implementation detail?