a...@gnu.org (Alfred M. Szmidt) writes: > > Was trying to have some fun and get `make coverage' working, but I'm > > hitting some werido problems that I don't understand. Does anyone > > know why this happens, and how to fix it? > > > > Processing src/tftp.gcda > > Processing src/tftp.gcda > > <built-in>:cannot open source file > > geninfo: ERROR: cannot read <built-in>.gcov! > > I've seen this too for other projects, and it is generally some > confusion about which directory to search for the *.gcda file. If > you strace lcov you will see that it is searching for the file at > the wrong place. Sometimes I create symlinks to work around this > (the output seems OK) if I really want to get the output, but it > would be great if this was tracked down and fixed properly. > > Hm. That is not at all what I'm seeing: > > | write(1, "TN:\n", 4TN: > | ) = 4 > | open("built-in>.gcov", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or > directory) > | write(2, "geninfo: ERROR: cannot read <bui"..., 45geninfo: ERROR: cannot > read <built-in>.gcov! > | ) = 45 > > It is trying to open "built-in>.gcov" which of course doesn't exist, > while it should try to open "<built-in>.gov", and just print a warning > since "<built-in>" cannot be found. The code in lcov that causes this is > from geninfo: > > | sub read_gcov_header($) > | { > | my $source; > | my $object; > | local *INPUT; > | > | if (!open(INPUT, $_[0])) > | { > | if ($ignore_errors[$ERROR_GCOV]) > | { > | warn("WARNING: cannot read $_[0]!\n"); > | return (undef,undef); > | } > | die("ERROR: cannot read $_[0]!\n"); > | } > > Why it is trying to open "built-in>.gcov" is a complete and utter > mystery to me... Anyone know of any perl to be able to fix this?
Hm. Maybe gcov/lcov needs to be teached about <built-in>? It may be that gcov prints that for built-in symbols. Lcov shouldn't try to open a file to get info about it. But I'm not certain, and reporting it to lcov seems like the right thing. /Simon