This is the mail archive of the mailing list for the elfutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: dwarf_aggregate_size() seems to fall over on pointer types

On Wed, Oct 01, 2014 at 10:46:52AM -0700, Josh Stone wrote:
> > Am I missing something? Is this a Clang bug or an elfutils bug?
> I don't think it's strictly a bug in either.  Clang is not required to
> produce byte_size, and elfutils is just reporting what it knows.
> Still, it might be nice if elfutils made that machine-class inference
> for you.  (But I worry about things like that mips pointer issue
> reported recently.)

Agreed. It seems reasonable for a consumer to assume that if any of
the reference/pointer types don't have an explicit size then they
should assume the type has address size. The DWARF spec does explicitly
call out DW_AT_address_class for pointer types. But that isn't really
helpful since it then only defines DW_ADDR_none and leaves any other
value as architecture defined.

How about the attached patch? (I haven't yet looked at the MIPS issue,
but think it reasonable to require the producer to add an explicit
DW_AT_byte_size if the assumption of address size is not correct.)



Attachment: 0001-libdw-dwarf_aggregate_size-return-CU-address_size-fo.patch
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]