Issue 240115.1: Add vallist class for list of DWARF expressions returning values
Author: | Cary Coutant |
---|---|
Champion: | Cary Coutant |
Date submitted: | 2024-01-15 |
Date revised: | 2024-04-26 |
Date closed: | |
Type: | Enhancement |
Status: | Open |
DWARF Version: | 6 |
Issue 211206.1, SIMD Location Descriptions, depends on this.
Background
In issue 230616.1, New Form Classes for Values vs.
Location Descriptions, the exprloc form class was replaced with
two separate classes, exprval and locdesc, to make it explicit
whether an attribute using a DW_FORM_exprloc
should evaluate that
attribute as a DWARF expression returning a value, or as a location
description.
In issue 211206.1, SIMD Location Descriptions,
a new attribute is proposed, whose value is meant to be a dynamic
attribute, but which may depend on the PC value. Rather than use
a location list (class loclist
), where each entry in the list
would necessarily contain an implicit location description,
it would be desirable to introduce the concept of a value
list, where each entry in the list is an expression yielding a value
(i.e., a list of exprval
rather than a list of locdesc
).
Rather than change location lists, as currently described, into a
more generic type of list, so that value lists and location lists
can both be described in terms of the generic list, this proposal
simply introduces value lists using the same representation as
(and leaning on the description of) location lists. It seems
unnecessary and too heavy to change, e.g., .debug_loclists
section names to .debug_exprlists
.
Proposal
In Section 2.2, Table 2.3, change the row for loclist and loclistsptr to:
Attribute Class General Use and Encoding vallist
,loclist
,loclistptr
Specifies a location in the DWARF section that holds value lists and location lists, which describe objects whose attributes or location can change during their lifetime.
Add a new Section 2.5.2:
2.5.2 Value Lists
Value lists are used in place of DWARF expressions whenever the value of an object's attribute can change during the lifetime of that object.
Value lists are contained in a separate object file section, along with location lists (see 2.6.2).
A value list is indicated by an attribute whose value is of class
vallist
(see Section 7.5.5 on page 223).A value list consists of a series of value list entries. The representation of a value list is the same as for a location list (see 2.6.2), except that bounded location description and default location description entries are understood to provide DWARF expressions that produce values rather than location descriptions.
[non-normative] The DWARF expressions in value list entries, being expressions and not location descriptions, may not contain any of the DWARF operations described in Section 2.6.
The address ranges defined by the bounded expressions of a value list may overlap. When they do, the meaning is undefined if the overlapping expressions do not produce the same value.
In Section 3.1.1, item 17 (DW_AT_loclists_base
), change "references
to location lists" to "references to value lists and location lists".
In Section 7.3.2.2 (Second Partition), fourth bullet, change "Location lists" to "Value lists and location lists".
In Section 7.5.5, Classes and Forms, after the exprval
bullet, add:
vallist
A Value List (see 2.5.2). This has the same representation as
loclist
.
For the loclist
bullet, add the following:
loclist
A Location List (see 2.6.2). This is represented ...
In Section 7.5.6, Form Encodings, add vallist
to the list of classes
for DW_FORM_loclistx
.
In Section 7.29, Location List Table, change the name of the section to "Value List and Location List Table".
In the first paragraph after item 5, change "a series of location lists" to "a series of value lists and location lists".
In the next paragraph, change "one offset for each location list" to "one offset for each value list and location list". Change "location of the _i_th location list" to "location of the _i_th value list or location list".
In the next paragraph, change "to access a location list" to "to access a value list or a location list" (two places).
In the next paragraph, insert "Value lists are described in Section 2.5.2 on page XX".
In the next paragraph, change "the location lists" to "the value lists and location lists".
In Appendix B, Figure B.1, note (j), change "location list" to "value list or location list". In note (o), change "location list entries" to "value list and location list entries".
For Figure B.2, note (jo), change "a location list" to "a value list or location list", and "location list entries" to "value list and location list entries".
In Appendix F, Section F.1, in the bullet for .debug_loclists.dwo
,
change "location lists" to "value lists and location lists" (two places).
In Section F.2.3, in the paragraph beginning "The .debug_loclists.dwo
section",
change "location lists" to "value lists and location lists".
2024-04-26: Revised to use the term "value list"; added text restricting use of location description operations.