On Wed, Oct 1, 2014 at 3:23 PM, Conrad Rad <cse.cem(a)gmail.com> wrote:
On Wed, Oct 1, 2014 at 3:10 PM, Conrad Rad <cse.cem(a)gmail.com>
wrote:
> On Wed, Oct 1, 2014 at 2:33 PM, Mark Wielaard <mjw(a)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
With the fixed patch (attached), it works:
agg_size(b.d): 0, 0x8
agg_size(b.e): 0, 0x18
Thanks,
Conrad