Issue 070709.1: Segment terminology cleanup

Author: Jim Blandy
Champion: Jim Blandy
Date submitted: 2007-07-09
Date revised:
Date closed:
Type: Editorial
Status: Accepted
DWARF Version: 4
Background:

There is some inconsistency in the usage of the terms "segment" and
"address" in the DWARF standard.  A discussion of this can be found
in <a href="http://lists.dwarfstd.org/pipermail/dwarf-workgroup-dwarfstd.org/2007-March/000312.html">DWARF v3's use of Segments</a>.

Proposal:

In section 2.12, "Segmented Addresses":

- Use the term 'segment selector' instead of 'segment value'.

In section 6.1.2, "Lookup by Address":

- Change item 5 to use the term 'segment selector' instead of 'segment
  descriptor'.

- Change the paragraph after the enumeration of the header values to
  read:

    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, and the non-zero length of that range.  A
    particular set is terminated by an entry consisting of three
    zeroes.  (When the 'segment_size' value in the set's header is
    zero, the segment selector is effectively omitted from all
    entries, 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.

Perhaps the parenthetical comment could be moved to a rationale
paragraph after this one, if the paragraph above would be clear enough
with it moved.

In section 7.3, "Executable Objects and Shared Objects":

- Change the first paragraph to read:

    The relocated addresses in the debugging information for an
    executable object are virtual addresses and the relocated
    addresses in the debugging information for a shared object are
    offsets relative to the start of the lowest region of memory
    loaded from that shared object.

  (This avoids using the word 'segment' in an inconsistent way.)

In section 7.20, "Address Range Table":

- Change item 5 to use the term 'segment selector' instead of 'segment
  descriptor'.

- Change the paragraph after the enumeration of the header values to
  read:

    This header is followed by a series of tuples. Each tuple consists
    of a segment, an address and a length.  The segment's size is
    given by the 'segment_length' field of the header; the address and
    length are each of the size given by the 'address_length' field of
    the header.  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, the size of a segment selector, plus 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 segment, 0 for the address and 0 for the length.  If the
    header's 'segment_length' field is zero, the segment selectors are
    omitted from all tuples, including the terminating tuple.