[Dwarf-Discuss] address values in constant forms
drow at false.org
Fri Dec 11 15:34:16 PST 2009
On Fri, Dec 11, 2009 at 03:10:30PM -0800, Roland McGrath wrote:
> 2. The "raw bytes stratum" distinguishes two kinds of "raw bytes": truly
> uninterpreted bytes, and bytes that are part of an address constant.
> An address constant is known to require adjustment by the consumer in
> ways that are well-defined on the platform (though themselves entirely
> outside the scope of DWARF).
> In this view, the precise meaning of DW_FORM_addr or DW_OP_addr is that
> it's an address constant requiring appropriate adjustment. In contrast
> data* forms are uninterpreted integer constants at this stratum,
> even when by the holistic semantics they are pointer/address values.
I don't think DW_OP_addr conveys enough information to do what you
want. For instance, what if a target has multiple pointer sizes?
Or worse, multiple pointer encodings?
You're never going to get all the way with this; there are always
going to be optimized out values that are not practical to compute
in DWARF. I'd like to see why this case is important enough to
bend over backwards to accomodate it.
Suppose you remove the static qualifier from your array `i'. How
do we then compute these values?
GNU binutils used to produce relocation for DWARF sections in shared
libraries and could do so again; GDB already has support to consume
it. I'm not suggesting that as an option, though. It caused all
sorts of trouble.
More information about the Dwarf-Discuss