Issue 121123.1: Inconsistent length field for location description in .debug_loc

Author: Kendrick Wong
Champion: Kendrick Wong
Date submitted: 2012-11-23
Date revised:
Date closed:
Type: Editorial
Status: Accepted
DWARF Version: 5
Section 7.7.3, pg 167
In 7.7.3 Location Lists:

"A location list entry consists of two address offsets followed by a 2-byte length, followed by a
block of contiguous bytes that contains a DWARF location description. The length specifies the 
number of bytes in that block."

The '2-byte length' is missing elsewhere
in 2.6.2 Location Lists:

"A location list entry consists of:

1. A beginning address offset. This address offset has the size of an address and is relative to 
the applicable base address of the compilation unit referencing this location list. It marks the 
beginning of the address range over which the location is valid.

2. An ending address offset. This address offset again has the size of an address and is relative 
to the applicable base address of the compilation unit referencing this location list. It marks 
the first address past the end of the address range over which the location is valid. The ending 
address must be greater than or equal to the beginning address.

A location list entry (but not a base address selection or end of list entry) whose beginning and 
ending addresses are equal has no effect because the size of the range covered by such an entry is
zero.

3. A single location description describing the location of the object over the range specified by
the beginning and end addresses.

Suggestion:
In 2.6.2:
Add between point 2. and 3.:
2.5: A 2 byte length describing the length of the location description that follows.

---

Accepted - 2/12/2013