This is the mail archive of the elfutils-devel@sourceware.org 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 1, 2014 at 3:10 PM, Conrad Rad <cse.cem@gmail.com> wrote:
> On Wed, Oct 1, 2014 at 2:33 PM, Mark Wielaard <mjw@redhat.com> wrote:
>> On Wed, Oct 01, 2014 at 10:46:52AM -0700, Josh Stone wrote:
>> 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.)
>
> On my repro, it fixes the pointer member, but not the array-of-pointer member.

Oh, wow, I misread. No, that's wrong.

> struct b {
>         char *d;
>         void *e[3];
> ...
> };
>
> $ ./repro a.out:
> ...
>         agg_size(b. (type  ) d): 8, 0xffffffff

This should be 0, 0x8. The size goes in the *size, return value of
dwarf_aggregate_size() should be zero on success, not 8. The patch is
not good as is.

Thanks,
Conrad

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