This is the mail archive of the
dwarf2@corp.sgi.com
mailing list for the dwarf2 project.
PROPOSAL(1): Clarification of use of class "constant"
- To: Michael Eager <eager at eagercon dot com>
- Subject: PROPOSAL(1): Clarification of use of class "constant"
- From: David Weatherford <david dot weatherford at sun dot com>
- Date: Mon, 10 Apr 2000 15:25:43 -0700
- Cc: Dwarf 2 <dwarf2 at corp dot sgi dot com>
- Organization: Sun Microsystems
- References: <38E8D81F.8B64ECEA@eagercon.com>
- Reply-To: David Weatherford <david dot weatherford at sun dot com>
Upon further reflection, I retract what I said regarding location lists
on 03/08:
> For it to work, it would have to be a *relocated* value, since the
> .debug_loc section contains the location lists from all compilation
> units and the value of the "constant offset" is defined to be the
> offset from the beginning of the .debug_loc section (sec 2.4.6).
(That much is true, but...)
> This implies a FORM_ref_addr that references the .debug_loc section.
^^^^^^^^^^^^^ wrong!
I now believe that FORM_ref_addr should *always* point to a DIE, and
the intended encoding for location lists was class "constant". The
value is relocatable and relative to the beginning of the .debug_loc
section. Most likely, FORM_data4 (or data8) would be used for
location lists.
In order to clear up the (evident!) confusion surrounding the proper
encoding of loclists, etc., I propose to make the following changes
(all editorial, no substantive differences):
1. In the discussion of location lists (2.5.3 in Draft 1), add to the
end of the first paragraph, after the sentence, "A location list is
indicated by a location attribute whose value is represented as a
constant offset from the beginning of the .debug_loc section to the
first byte of the list for the object in question.":
This offset is relocatable in a relocatable object file and
relocated in an executable or shared object.
2. Similarly, in the discussion of DW_AT_stmt_list, (3.1, number 5),
add just before the last sentence of the second paragraph,
This offset is relocatable in a relocatable object file and
relocated in an executable or shared object.
3. Same section, number 6 (DW_AT_macro_info), second paragraph, add
This offset is relocatable in a relocatable object file and
relocated in an executable or shared object.
4. In section 7.5.4, Attribute Encodings, add the following paragraphs
after the existing paragraph describing class "constant":
Constants are also used to represent offsets into the .debug_loc
section. Any attribute that takes a DWARF expression as its
value may have either a block or a constant form. The former
indicates a single DWARF expression; the latter a location
list (see Section 2.5.3). DW_AT_data_member_location is an
exception; see Section 5.5.4.
Attributes that reference .debug_line or .debug_macinfo also
have a constant form.
5. In Figure 17, Attribute encodings, modify the "Classes" entry of
the following attributes as shown:
DW_AT_data_member_location block, constant
DW_AT_vtable_elem_location block, constant
Ron, I assume you intended to drop the interpretation of reference-class
forms for DW_AT_data_member_location. If not, we need to add some
verbiage that describes it to Section 5.5.4.
--
Dave Weatherford Forte Tools
David.Weatherford@Sun.COM Sun Microsystems, Inc.