Re: [patch] ptype: show members of an unnamed struct inside an union

Joel Brobecker
2007-08-29T20:41:24Z

> > This isn't the same as what we were talking about. This is when
> > the type has no name; an anonymous union is when the field has no
> > name.
> >
> > This might be a good idea too - I'm not decided on that...
> >
> IMHO, I think this is more informative to the user. But that's just my
> $0.02... :)

I agree with Daniel. Doing what you propose is partly defeating what
the current code is doing, only because the type is anonymous. In
the case of large structs which include other structs which include
other structs, this makes a big difference in readability.

The one reason I think it's a good idea to expand the field description
when the field does not have a name, is because there is no way to
get that information otherwise. But in the case of a named field that
has an anonymous type, we can easily get the type information simply
by selecting it (I mean by that: "ptype my_page.u" where u is the field
name of your union).

One last comment: The change you made is affecting both structs and
unions. Is that what we want? So far, the discussion was only geared
towards unions.

--
Joel