[PATCH] libdw: Handle DWARF5 line tables in dwarf_getsrclines.

Mark Wielaard mark@klomp.org
Fri May 11 15:25:00 GMT 2018

On Tue, 2018-05-08 at 00:06 +0200, Mark Wielaard wrote:
> In DWARF5 the actual line number table format doesn't change, except for
> not allowing DW_LNE_define_file (but we still just accept it). The
> changes are the header having new fields for address and segment
> selector sizes, and new formats for the directory and file names tables.
> The directory and file name tables are much more flexible in DWARF5, but
> we only interpret the actual names and file/dir index relationships,
> skipping/ignoring any other information. There also is no new interface
> yet to get at the new directory and file properties.
> There is some small confusion about the file name table indexing. Older
> DWARF versions explicitly called the first file name table 1. DWARF5
> implies the first index is 0 (but for file attributes, zero means not
> associated with a file). We get away with that by having an actual zero
> index for older DWARF versions (the null_fill). It looks like gcc gets
> around it by explicitly duplicating the first (0) and second (1) file
> name entry in the table. This can also be seen in the new testcase.
> The patch looks big because of moving a few initializations around
> and because the code that is different for older/newer DWARF got moved
> under if statements. But the original old DWARF code path didn't really
> change.

Pushed to master.

More information about the Elfutils-devel mailing list