register name for DW_AT_frame_base value

Daniel Berlin dberlin@dberlin.org
Tue Apr 19 17:34:00 GMT 2005


On Tue, 2005-04-19 at 18:29 +0200, Jerome Guitton wrote:
> A Dwarf interpretation question:
> 
> We have a problem to make GCC-compiled code interact with the HP
> native debugger, and it looks like it is caused by the way the
> attribute DW_AT_frame_base is interpreted. Apparently, when a frame
> pointer can be found in a register, the value generated by GCC for the
> DW_AT_frame_base of the corresponding subroutine is a register name
> (i.e. DW_OP_reg<some_number>). Is it really allowed by the dwarf 2
> standard? I would tend to think that it is not.
> 
> The "definition" of DW_AT_frame_base is:
>         
> "A subroutine or entry point entry 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."
> 
> OK. So, it is a location description. A location description can be
> either a register name or an addressing operation, so at first glance
> it is correct. But if the value is a "location description that
> computes the frame base", when evaluated it should be an address;
> so it cannot be a register name, IMHO.

> So, when a frame pointer is stored into a register <regno>, I would
> say that the value of DW_AT_frame_base should be something like
> "DW_OP_bregx <regno> 0" instead of something like "DW_OP_regx <regno>".

We are having this exact discussion on the DWARF3 standard mailing list
right now (whether fbreg has an implicit dereference, etc).

You should probably take this there.




More information about the Gcc mailing list