gcov and logical lines of code spanning multiple source lines

Gordon Bowring gordon.bowring@oracle.com
Wed Sep 28 22:09:00 GMT 2016


    I am using the gcov utility to provide my team with detailed information showing the effectiveness of our testing by displaying which lines of our code are executed by each of our tests.  The basic functionality is working fine and I have been able to collect and process the ".gcda" files for each of the instrumented modules and then generate the associated ".gcov" file for each module.

    My problem is that when I am displaying the results to my colleagues if a logical line of code is written in such a way that is extends over multiple lines in the original source file only the initial line number, in the ".gcov" file, has an associated execution count.  Is there a way to get the execution count reported against all of the source lines that make up the single  logical line of code ?  Alternatively is there a way to generate a file listing the logical lines of code and their associated line numbers from the original source file ?

    Any help you can provide me will be greatly appreciated.  Many thanks,


More information about the Gcc-help mailing list