[Dwarf-Discuss] line table dir/file

Robinson, Paul paul.robinson@sony.com
Mon Feb 24 19:34:36 GMT 2020


When the committee was reworking the file/dir tables for DWARF v5, 
one thing that came up was that the root file/directory were *not* 
in the .debug_line section, and therefore the line table could not 
be interpreted fully without a .debug_info section, because that 
was where the root file and compilation directory were kept--not 
in the line table itself.  Am I imagining this discussion?  We 
added text to the document specifically describing file/dir 0 and 
that they were to be explicitly kept (duplicated from .debug_info) 
so that the .debug_line section could be fully dumped even in the
absence of a corresponding .debug_info section.  This was the
"strip all but the line table" scenario.

I can easily believe that nobody *actually uses* file/dir 0, but
that's a different question from what producers are supposed to
produce in v5 and how consumers are supposed to interpret it.

Offhand it looks like there are three possibilities:
a) Clang got it right and everyone else got it wrong.
b) The spec is ambiguous and we're observing the consequences.
c) Clang got it wrong and everyone else got it right.

But in all three cases, we need to settle on (i) what the spec
actually says, (ii) does it say what the committee intended,
(iii) if not, what to do about it.

I don't think we should start with (iii).

> -----Original Message-----
> From: Dwarf-Discuss <dwarf-discuss-bounces at lists.dwarfstd.org> On Behalf
> Of David Anderson via Dwarf-Discuss
> Sent: Friday, February 21, 2020 5:40 PM
> To: dwarf-discuss at lists.dwarfstd.org
> Subject: [Dwarf-Discuss] line table dir/file
> I've attached a pdf that
> shows some cases of current usage of the line
> table directory and file arrays and of indexes.
> clang seems (with my limited access to other compilers)
> the outlier in treating a index of 0 (from file [N] to
> the directory)? as
> a 0 origin references.
> Only 0-origin for DWARF5.
> So reserving 0 as an index to the directories table
> to mean 'no directory available'? would
> seem to be the right course.
> The standard (or an errata, if we do such a thing)
> needs works to establish 1-origin for these indexes into
> the directory table and clarifies the 1-origin
> indexes by referencing such in more places
> in the document.
> A tar.gz of the test setup is available by email
> if anyone cares.? It is about 1 MiB in size (most
> of the size is in two ancient IRIX Elf files)..
> David Anderson

More information about the Dwarf-discuss mailing list