This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: [RFA] PR 11530: Fix and test case



> -----Message d'origine-----
> De?: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Jan Kratochvil
> Envoyé?: Friday, April 30, 2010 10:20 AM
> À?: Pierre Muller
> Cc?: gdb-patches@sourceware.org
> Objet?: Re: [RFA] PR 11530: Fix and test case
> 
> On Thu, 29 Apr 2010 23:50:15 +0200, Pierre Muller wrote:
> > --- src/gdb/gdbtypes.c	21 Apr 2010 23:21:03 -0000	1.189
> > +++ src/gdb/gdbtypes.c	29 Apr 2010 21:23:35 -0000
> > @@ -1246,6 +1246,13 @@ lookup_struct_elt_type (struct type *typ
> >  	{
> >  	  return TYPE_FIELD_TYPE (type, i);
> >  	}
> > +      else if (!t_field_name || *t_field_name == '\0')
> > +	{
> > +	  struct type *subtype = lookup_struct_elt_type (
> > +				   TYPE_FIELD_TYPE (type, i), name, 1);
> 
> IMO
> 	  struct type *subtype;
> 
> 	  subtype = lookup_struct_elt_type TYPE_FIELD_TYPE (type, i),
> name, 1);

  This looks better, indeed.
 
> > +	  if (subtype != NULL)
> > +	    return subtype;
> > +	}
> >      }
> 
> 
> I was now thinking about a possible name clash.  As these anonymous
> structs/unions are a GNU extension there is no offical standard for it
> but the
> GCC texinfo file describes it as an error which GCC currently does not
> report.
> I have not found a GCC PR for it.

  I don't want to try to test those GCC bugs
I just want to fix the simple case in which there is
no, name conflict.

  With my patch, GDB will find the first instance
that matches the field name, but I don't even know 
if the ordering given by the debug information necessarily 
follows the definition order in the source!

  Anyhow, this patch is only useful for sizeof (),
not for printing of the value itself, which
was already working...


Pierre Muller
Pascal language support maintainer for GDB




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