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

jeff nelson jeff.nelson
Wed Apr 20 14:46:01 GMT 2005


So far I'd say there is no striking consensus except that the
description of FBREG could be made more clear. There are some who think
there should be an automatic dereference and some that don't.

Recall that there are two independent expressions being evaluated: the
DW_OP_fbreg itself, and the expression at DW_AT_frame_base.

If I understand correctly, those who suggest that an automatic deference
should be performed are in effect saying that FBREG works like this:

1. evaluate the DW_AT_frame_base expression
2. dereference the value from step 1
3. add the DW_OP_fbreg operand

One of the problems with this approach is that the compiler must
construct a DW_AT_frame_base expression that yields the *address* of the
value. While it's easy to see how this is done for registers, how about
for a memory location? Now you need an address of an address. I believe
this is an unreasonable interpretation.

In my opinion, the FBREG operator works like this:

1. evaluate the DW_AT_frame_base expression
2. add the DW_OP_fbreg operand

In other words, the evaluation of DW_AT_frame_base needs to return a
usable value on its own, without any additional dereferencing. Ron
Brender pointed out examples in the Dwarf spec that supports this
interpretation therefore I'd like to believe this is what was originally
intended.

-Jeff





More information about the Dwarf-discuss mailing list