#78 lcov/geninfo should support function tokens in .gcov files

Commands
closed-out-of-date
Tools (21)
5
2007-05-16
2005-08-31
Martin Reddy
No

We just upgraded to gcc/gcov 4.0 and lcov stopped
working on our code. After some digging, it appears
that the geninfo script was choking on some 'function'
tokens in the .gcov file that were for Objective-C
code. Objective-C methods can look like:

-[MethodName value:isEqualToValue:]

And in certain instances, the colons in this function
name were fooling geninfo into thinking this matched
the <exec count>:<line number>:<source code> regex in
read_gcov_file(). Things went pear-shaped pretty
quickly after that.

The solution is to explicit check for the function
token, like is already being done for the branch and
call tokens in the .gcov file. For example, add the
following code after the 'elsif (/^call/)' line in
read_gcov_file():

elsif (/^function/)
{
# Function execution
summary
}

That fixed the problem for us anyway.

Cheers,

Martin.

Discussion

    • assigned_to: nobody --> mridge
     
  • Subrata Modak
    Subrata Modak
    2007-05-16

    • status: open --> closed-out-of-date