This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PING**3] [PATCH] Force use of absolute path names for gcov


On 06/01/2017 03:24 PM, Bernd Edlinger wrote:

This is a gcc option that converts relative
path names to absolute ones, so that gcov can
properly merge the line numbers in projects
where different relative path names may refer
to the same source file.

Thanks. From reading the patch though, I didn't grok that intent. The patch itself suggests gcov simply fails with relative paths and directories. What you're really trying to do is find the canonical path, which happens to be absolute. But you're not doing that either -- you're concatenating the relative path to cwd. How is that helping? Is it when you have a mixture of absolute and relative paths?

Some other cases:
1) 'bob/../foo.c' and 'baz/../foo.c'?
2) 'bob/foo.c' and 'baz/foo.c' where baz is a symlink to bob?
3) combinations of #2 and #3 such that textual elision of .. gets you to a different place than resolving symlinks.

Given all that complexity, wouldn't it be better to tell gcov where relative paths should start? (perhaps encoding in the file?). It does need access to the source directories.

note libiberty has lrealpath to do (much of?) what you want.

nathan

--
Nathan Sidwell


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]