Relative path X full path

Mark Wielaard
Tue Apr 3 11:10:00 GMT 2018

On Thu, 2018-03-29 at 14:10 +0200, Mark Wielaard wrote:
> It does indeed come up more often, and it is a little confusing.
> So I am proposing the following documentation update to hopefully
> explain better how to get the absolute path for a file (decl).

I did discuss this offlist a bit more with Sasha.
I am now convinced this really is somewhat inconsistent.
And I was tempted to "fix" it by just always adding the comp_dir to any
 relative path we return. But this would increase the memory usage for
line tables even more (we store the whole path when we parse the table
for the first time). And it has been this way so long that people might
even rely on what we return now.

In hindsight these interfaces should never have merged the file path
and directory paths, but kept them separate. By returning just a full
path it is impossible to see the original separate paths. Which might
be interesting to some clients. Since DWARF5 adds a way to add various
properties to file entries we should just add a new API that lets you
query any property of a file entry you like (including the file path
and dir path).

So for now I just pushed this documentation update. And keep the code
as is.



More information about the Elfutils-devel mailing list