This is the mail archive of the dwarf2@corp.sgi.com mailing list for the dwarf2 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PROPOSAL(1): Clarification of use of class "constant"


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]