Issue 220212.1: Disambiguate "ending address/offset" in location lists and range lists

Author: Ron Brender
Champion: Ron Brender
Date submitted: 2022-02-12
Date revised:
Date closed: 2022-10-31
Type: Editorial
Status: Accepted with editorial changes
DWARF Version: 6
Section 2.6.2 & 2.17, pg 43,45, 54
PROBLEM
-------

 In the description of 2.6.2 Location Lists we find:
 
    [[page 43, lines 13-18]]
    o  Bounded location description. This kind of entry provides a location
    description that specifies the location of an object that is valid over a
    lifetime bounded by a starting and ending address. The starting address is
    the lowest address of the address range over which the location is valid.
    The ending address is the address of the first location past the highest
    address of the address range.

This makes clear that the "ending address" is not included in the given range.

Later, we find:

    [[page 45, lines 14-17]]
    5. DW_LLE_offset_pair
    This is a form of bounded location description entry that has two unsigned
    LEB128 operands. The values of these operands are the starting and ending
    offsets, respectively, relative to the applicable base address, that define
    the address range for which this location is valid.

This text is two pages removed from the definition of "ending address" given earlier.
And, without that earlier context it can easily be read as though the ending address
is included in the range (that is, is the highest address of the range, not one past
it).

To preclude such a misreading, I propose to insert immediately following "ending
offset":

    "(that is, the first offset past the highest offset of the offset range)"


With that change, the DW_LLE_offset_pair description reads as follows:

  This is a form of bounded location description entry that has two unsigned
  LEB128 operands. The values of these operands are the starting and ending
  offsets (that is, the first offset past the highest offset of the offset
  range), respectively, relative to the applicable base address, that define
  the address range for which this location is valid.

Similar wording appears later on the same page for DW_LLE_start_end where the two
operand values "indicate the starting and ending addresses...that define the address
range". The analogous insertion referring to addresses is appropriate.

Finally, identical wording ambiguities occur in Section 2.17 for DW_RLE_offset_pair
and DW_RLE_start_end, respectively, and the same disambiguation is in order.

To be explicit and complete here are the proposed changes.

PROPOSED CHANGES
--------------------------------

1) Section 2.6.2, page 45, bullet 5: Following "ending offset" insert

    "(that is, the first offset past the highest offset of the offset range)"


2) Section 2.6.2, page 45, bullet 8: Following "ending address" insert

    "(that is, the first address past the highest address of the address range)"


3) Section 2.17, page 54, bullet 5: Following "ending offset" insert

    "(that is, the first offset past the highest offset of the offset range)"


4) Section 2.17, page 54, bullet 7: Following "ending address" insert

    "(that is, the first address past the highest address of the address range)"

--
2022-10-31: Accepted with editorial changes
   Make it clear that that the “ending address” is not included in the given range.
   Use a backward reference for bounded location description.