[Dwarf-Discuss] DWARF piece questions

Michael Eager eager@eagercon.com
Sat Jan 28 07:36:59 GMT 2017


On 01/27/2017 04:55 PM, Cary Coutant wrote:
>>>>> * Is "DW_OP_reg*" followed by "DW_OP_piece(size of object type)" always
>>>>>   equivalent to omitting the piece operation?
>>>>
>>>> If sizeof(obj) == sizeof(reg) it is obviously.
>>>> If sizeof(obj) > sizeof(reg) the expression is malformed because there
>>>> are undefined bits in the object that should have been represented
>>>> with an empty DW_OP_piece.
>>>
>>> GCC may describe a long double struct member on x86 as
>>>
>>>    DW_OP_regx: 33 (st0); DW_OP_piece: 16
>>>
>>> where st0 is only 10 bytes wide.  Is that invalid then?
>
> I think we should acknowledge in the text somewhere that there are
> some registers where the bits transfer unchanged between memory and
> register (e.g., general registers), and others where some translation
> happens (e.g., floating-point registers). For the latter, I think it
> makes the most sense to think of the x86 80-bit floating point
> registers as if they were really 128 bits wide, and the translation is
> implicit via knowledge of the architecture (ABI).

We are talking about the DWARF Standard, aren't we, not the X86 ISA?

The X86 ISA specification should describe the result of executing an
instruction which transfers a value between a register and memory.

If you want to say something in DWARF like "values in a register may be
represented unchanged or differently from the value in memory" that may be
true and completely uninformative.  And I'm not sure that you can define
what "unchanged" means.  Little-endian and big-endian store the bytes
of a register in different orders.  Which is unchanged?

-- 
Michael Eager	 eager at eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077



More information about the Dwarf-discuss mailing list