Re: Patch: Dwarf2 reader -vs- DW_OP_piece

Tom Tromey
2002-02-21T22:58:43Z

>>>>> "Jim" == Jim Blandy <jimb@redhat.com> writes:

Jim> Can you explain what sorts of location expressions this is
Jim> supposed to help GDB handle?

Yes, sorry.

Suppose a value spans multiple registers. Currently gcc encodes this
as DW_OP_reg for the first register. However, I believe that is not
fully correct according to the Dwarf-2 spec.

The gcc patch changes the output in this case to a series of
DW_OP_reg/DW_OP_piece instructions.

So previously gcc could generate this for a `long long' value (on x86
Linux):

DW_OP_reg1

With the patch gcc will now generate:

DW_OP_reg1
DW_OP_piece 4
DW_OP_reg2
DW_OP_piece 4

Tom