Re: Relative path X full path

2018-04-03 Thread Mark Wielaard
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.

Cheers,

Mark


Re: [PATCH] libdw: Add support for reading DW_FORM_addrx[1234] in .debug_addr.

2018-04-03 Thread Mark Wielaard
On Fri, 2018-03-30 at 17:56 +0200, Mark Wielaard wrote:
> Recognize the new .debug_addr section. The CU will now hold a new
> address base offset in that section for that CU. dwarf_form_addr will
> decode DW_FORM_addrx[1234] and return addresses using that address
> base from the .debug_addr. A new internal function read_3ubyte_unaligned
> will try to read a 24-bit value depending on endianness of the underlying
> file.

Pushed to master.


Re: [PATCH] libdw: Add support for reading DW_FORM_strx[1234] in .debug_str_offsets.

2018-04-03 Thread Mark Wielaard
On Fri, 2018-03-30 at 17:57 +0200, Mark Wielaard wrote:
> Recognize the new .debug_str_offsets section. The CU will now hold a new
> str_off_base offset in that section for that CU. dwarf_form_string will
> decode DW_FORM_strx[1234] and return strings using that str_off_base
> from the .debug_addr.

Pushed to master.