Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attribute result or value? #74

Open
markus-metzger opened this issue Jan 31, 2023 · 3 comments
Open

attribute result or value? #74

markus-metzger opened this issue Jan 31, 2023 · 3 comments

Comments

@markus-metzger
Copy link

The result of the attribute is obtained by evaluating a DW_OP_offset B
refers to the result of an attribute. Shouldn't the term be value rather than result?

@t-tye
Copy link
Contributor

t-tye commented Jan 31, 2023

The purpose of the DW_AT_data_member_location attribute is to obtain the location description of the data member given the location description of the base of the object. It provides two ways to encode how that action is done. If it is encoded as a constant, then the base location description is offset by the value of the constant to produce the result that is a location description. If it is encoded as an operation expression then the expression is evaluated with an initial stack containing the base object location description. The result of the evaluation is a location description.

So to avoid confusion that expression results can be values or location descriptions, the term "result" has been used when discussing what attributes produce.

@markus-metzger
Copy link
Author

DWARF-5 uses the term 'attribute value'.

@t-tye
Copy link
Contributor

t-tye commented Feb 2, 2023

Looking at the use of "attribute value" in DWARF 5 it seems it refers to what is held in the attribute. For example, what form is used, or what DWARF expression is present. To get the result of the attribute you have to "evaluate" that form or DWARF expression. Other places use other language such as "attribute describes". So DWARF 5 seems pretty varied on what it means by an attributes value.

Using "attribute result" was intended to convey the outcome of evaluating the attribute value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants