[PATCH] D75326: [entry values] X86: Describe effects of MOV{8,16}ri (PR45053)

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 28 10:14:13 PST 2020


vsk added a comment.

In D75326#1898169 <https://reviews.llvm.org/D75326#1898169>, @dstenb wrote:

> In D75326#1898071 <https://reviews.llvm.org/D75326#1898071>, @vsk wrote:
>
> > Thank you @dstenb and @djtodoro very much for your feedback.
> >
> > I think I've addressed the main issue, we now produce `DW_AT_call_value (DW_OP_constu 0x840, DW_OP_stack_value, DW_OP_piece 0x2)`. PTAL.
>
>
> I might be incorrect here, but I don't think we are allowed to use DW_OP_piece operations in DW_AT_call_value attributes, as they should be DWARF expressions? As far as I have understood it, the DW_OP_piece operation is only allowed in composite location descriptions, and you can in general not go from location descriptions to DWARF expressions, with the only (?) exception being DW_OP_entry_value operations holding register location descriptions.
>
> (This seems a bit related to D75270 <https://reviews.llvm.org/D75270>, in which I stop emitting entry values around composite location descriptions, since the DWARF standard specifies that those are only allowed to hold DWARF expressions and register location descriptions.)


If I understand your reading correctly, it's that composite location descriptions are not (in general) a kind of DWARF expression.

FWIW, this doesn't line up with my understanding. DWARF5 says "a single location description" may be "a composite location description", which consists of "one or more simple location descriptions", each of which describes "one piece of the object" (2.6.1). And it says that a DWARF expression describes "how to compute a value or specify a location" (2.5). That certainly /sounds/ like a composite location can be a DWARF expression.

Even if I've read the standard incorrectly, I'm not sure what the point of this distinction would be. Having implemented the OP_entry_value support in lldb, istm that there is no difficulty for the debugger in handling a composite location in an entry value. Ah, but reading your comment in D75270 <https://reviews.llvm.org/D75270>, it sounds like GDB doesn't support this. Could that simply be a GDB bug?

If OP_piece in an entry value really /is/ an issue, please confirm, and I'll update the x86 describeLoadedValue to just return 'None' for mov{8,16}ri (it doesn't seem worth it to me to do anything more complicated).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75326/new/

https://reviews.llvm.org/D75326





More information about the llvm-commits mailing list