From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============9217488528716546570==" MIME-Version: 1.0 From: Conrad Rad To: elfutils-devel@lists.fedorahosted.org Subject: Re: dwarf_aggregate_size() seems to fall over on pointer types Date: Wed, 01 Oct 2014 15:23:07 -0400 Message-ID: In-Reply-To: CAG6CVpXZRinqsUouO=ZOpDg_S2KV7i+7zVd1C1daxWTrKq4MDA@mail.gmail.com --===============9217488528716546570== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Wed, Oct 1, 2014 at 3:10 PM, Conrad Rad wrote: > On Wed, Oct 1, 2014 at 2:33 PM, Mark Wielaard 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 me= mber. 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 --===============9217488528716546570==--