[Dwarf-discuss] Interpretation of FBREG: implied deref of frame_base?
Ron 603-884-2088
brender
Thu Apr 21 14:52:15 GMT 2005
There seems to be a general feeling that DW_OP_reg<n> should be
a valid frame base location that "computes" a frame base address
by taking the contents of the register <n>.
I am trying figure out how best to express that in the DWARF
document.
I don't think anything belongs in the description of the
DW_OP_reg<n> operators themselves. This implicit dereference does
not, after all, apply to a location expression for a variable
that is allocated in a register.
It appears that the DW_OP_fbreg operator is the only DWARF
construct whose definition uses the frame base value, so it is
perhaps possible to incorporate the implicit dereference there.
However, other parts of a debugger probably also could or do make
use of the frame base address, so it seems better to incorporate
the explanation in the frame base attribute description proper.
The current description of DW_AT_frame_base (Section 3.3.5, page
46 of V3) reads:
A subroutine or entry point may also have a DW_AT_frame_base
attribute, whose value is a location description that
computes the "frame base" for the subroutine or entry point.
I propose the following replacement:
A subroutine or entry point may also have a DW_AT_frame_base
attribute, whose value is a location description. Evaluation
of that location description computes the "frame base"
address, which can serve as a base pointer for accessing
locations in the frame of that subroutine or entry. In the
special case that the location expression is one of the
register name operators (see Section 2.5.1), the given
register is implicitly dereferenced to obtain the contents
of the register.
<i>For example, for the DW_AT_frame_base attribute (and
only that attribute) the location expression DW_OP_reg7
is equivalent to either of the expressions
<b>DW_OP_reg7 DW_OP_deref</b> or <b>DW_OP_breg7 0</b></i>.
<i>This special case interpretation confirms established
practice and provides a useful interpretation to an
otherwise undefined construction.</i>
Thoughts?
Ron
More information about the Dwarf-discuss
mailing list