Re: DWARF2 FDE Address Mismatch

Matt Kern
2007-06-05T10:37:32Z

Okay -- I have a patch which works for our arch. I haven't tested it on
a stable arch yet though to ensure it doesn't break anything.

The change is to call read_encoded_value() if eh_frame_p is set;
otherwise dwarf2_read_address() is called. I have modified
dwarf2_read_address to read addresses of size TARGET_ADDR_BIT rather
than TARGET_INT_BIT.

> For .eh_frame we have to do this funny dance with GCC to determine the
> "right" behavior. For .debug_frame, there is a standard and we should
> be following it - and so should GCC. What does it have to say? If it
> says "the size of an address on the target machine" then we should
> probably use TARGET_ADDR_BIT; otherwise I'm not sure. I think this
> format ambiguity has come up before.

From "7.5.4 Attribute Encodings":

"address Represented as an object of appropriate size to hold an
address on the target machine (DW_FORM_addr)."