[Dwarf-Discuss] DWARF piece questions
ccoutant at gmail.com
Fri Jan 27 16:55:47 PST 2017
>>>> * 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).
More information about the Dwarf-Discuss