Issue 020201.1: DW_AT_segment

Author: Keith Walker
Champion: Matthew Gretton-Dann
Date submitted: 2002-02-01
Date revised:
Date closed:
Type: Clarification
Status: Accepted with modifications
DWARF Version: 3
QUESTION

The following question was posed by Keith Walker on 13 February 2002:

In DWARF V3 Draft 7, Figure 18. Attribute encodings, should the entry for
DW_AT_segment be "block, loclistptr" and not "block, constant"?

The DW_AT_segment entry is described in section 2.11 as:

        "Any debugging information entry that contains a description
         of the location of an object or subroutine may have a
         DW_AT_segment attribute, whose value is a location
         description."

Ron Brender replied:

Yes, but...

It appears that the DW_AT_segment attribute got overlooked when we
introduced the loclistptr concept/vocabulary. So, in that sense I
believe the answer is "Yes". loclistptr is the only way to allow use
of location lists, which seems clearly intended in V2.

However, it appears that much like DW_AT_data_member_location, a better
set of classes is all three of block, constant and loclistptr. One might
expect that a very common special case is for the segment number to be a
(small) constant which makes the interpretation of the attribute as an
immediate value rather than a .debug_loc offset worthwhile. Allowing
this is marginally substantive and deserves more formal consideration.
There may be some slight editorial ramifications elsewhere that need
to be checked as well.


PROPOSAL

Allow the following three classes of values for the DW_AT_segment
attribute: block, constant and loclistptr. Note that block and
constant are already included in Figure 18, while loclistptr is
a proposed addition.

==============================================================
5/17/2005:  Accepted with modifications:
  Replace "constant" with "loclistptr" in Fig. 18 for DW_AT_segment.