[Dwarf-discuss] Interpretation of FBREG: implied deref of frame_based?

Ron 603-884-2088 brender
Wed Apr 20 15:10:34 GMT 2005


>I prefer this:
>
>2. Interpret the result from step 1 as a value.
>
>For an address, it's an address.  For a register, it's the contents of
>the register.

This implies that that

    DW_OP_regx x		! Evaluates to the name of reg x
and
    DW_OP_bregx x 0		! Evaluates to the contents of reg x + 0

mean the same thing -- certainly seems odd.

But, if a variable Z has the location expression

    DW_OP_regx x

then its location is the register x, not where x points, while for
the expression

    DW_OP_bregx x 0		! Evaluates to the contents of reg x + 0

the location of Z is the value contained in register x. That is,
there is a very real and important difference in meaning.

Finally, suppose that the framebase attribute was

    DW_OP_regx x DW_OP_piece 8	! Assume an address and the register size is 8

Seems like DW_OP_piece can only meaningfully qualify a register name,
so that this means "the low 8 bytes of register x". If it meant "the
low eight bytes of the memory location pointed to by x" it would not
be needed, because that can be expressed using the DW_OP_and operation.

Ron





More information about the Dwarf-discuss mailing list