This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFA: unbreak typedefed bitfield
On Friday 18 December 2009 17:17:40 Daniel Jacobowitz wrote:
> On Fri, Dec 18, 2009 at 05:06:12PM +0400, Joel Brobecker wrote:
> > > --- a/gdb/value.c
> > > +++ b/gdb/value.c
> > > @@ -1873,6 +1873,7 @@ value_primitive_field (struct value *arg1, int offset,
> > >
> > > CHECK_TYPEDEF (arg_type);
> > > type = TYPE_FIELD_TYPE (arg_type, fieldno);
> > > + check_typedef (type);
> > >
> > > /* Handle packed fields */
> >
> > Looks OK to me (you forgot the ChangeLog entry, btw).
>
> What does this do? CHECK_TYPEDEF side-effects its argument;
> check_typedef will leave its argument as a TYPE_CODE_TYPEDEF. I think
> it fills in some other fields in the typedef, is that what matters
> here?
Yes. It makes
int container_bitsize = TYPE_LENGTH (type) * 8;
below not to set 'container_bitsize' to 0.
> It's unusual to see check_typedef without an assignment.
I can surely use
type = check_typedef (type);
if that seems less confusing.
- Volodya