[Dwarf-discuss] Aranges address entry alignment?

Vsevolod Alekseyev sevaa@sprynet.com
Sat Jul 13 18:33:23 GMT 2024


In DWARF v3, section 7.20 deals with the structure of the debug_aranges
section. Near the end, there is the following paragraph:

 

"This header is followed by a series of tuples. Each tuple consists of an
address and a length, each in the size appropriate for an address on the
target architecture. The first tuple following the header in each set begins
at an offset that is a multiple of the size of a single tuple (that is,
twice the size of an address). The header is padded, if necessary, to the
appropriate boundary. Each set of tuples is terminated by a 0 for the
address and 0 for the length."

 

Note the third sentence:

 

"The first tuple following the header in each set begins at an offset that
is a multiple of the size of a single tuple (that is, twice the size of an
address)."

 

Meanwhile in DWARFv4, section 6.1.2, which describes the same, the
corresponding fragment goes:

 

"This header is followed by a variable number of address range descriptors.
Each descriptor is a triple consisting of a segment selector, the beginning
address within that segment of a range of text or data covered by some entry
owned by the corresponding compilation unit, followed by the non-zero length
of that range. A particular set is terminated by an entry consisting of
three zeroes. When the segment_size value is zero in the header, the segment
selector is omitted so that each descriptor is just a pair, including the
terminating entry. By scanning the table, a debugger can quickly decide
which compilation unit to look in to find the debugging information for an
object that has a given address. 

If the range of addresses covered by the text and/or data of a compilation
unit is not contiguous, then there may be multiple address range descriptors
for that compilation unit."

 

Note that there is no mention of the triple/tuple  alignment requirement.
The version number in the aranges CU header is supposed to be 2 both in
DWARF v4 and DWARF v3. Meanwhile, the alignment or lack thereof does make a
difference for a parser. Is there a preferred way to disambiguate?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dwarfstd.org/pipermail/dwarf-discuss/attachments/20240713/9a6f47c5/attachment.htm>


More information about the Dwarf-discuss mailing list