[RFA] PR 11530: Fix and test case

Pierre Muller pierre.muller@ics-cnrs.unistra.fr
Wed May 5 21:44:00 GMT 2010



> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Tom Tromey
> Envoyé : Friday, April 30, 2010 7:30 PM
> À : Pierre Muller
> Cc : 'Jan Kratochvil'; gdb-patches@sourceware.org
> Objet : Re: [RFA] PR 11530: Fix and test case
> 
> >>>>> "Pierre" == Pierre Muller <pierre.muller@ics-cnrs.unistra.fr>
> writes:
> 
> Pierre> I just want to fix the simple case in which there is
> Pierre> no, name conflict.
> 
> It seems pretty reasonable to me.
> 
> Pierre>   With my patch, GDB will find the first instance
> Pierre> that matches the field name, but I don't even know
> Pierre> if the ordering given by the debug information necessarily
> Pierre> follows the definition order in the source!
> 
> I skimmed this part of the DWARF 4 spec (5.5.6 Data Member Entries) but
> I didn't see any such requirement.
> 
> I'm not too concerned about this.
> 
> Pierre>   Anyhow, this patch is only useful for sizeof (),
> Pierre> not for printing of the value itself, which
> Pierre> was already working...
> 
> That is interesting.  Why does it work in one case but not the other?

  for the first test 'p a.i'
gdb calls search_struct_field,
which has already some code (around line 1842)
to cope for unnamed fields.
  There was no equivalent in the lookup_struct_elt_type
function.

  By the way, the search_struct_field function
also allows a union called "else" to be searched.
Should this also be inserted into lookup_struct_elt_type
or is this only a left over from Chill language?

Pierre




More information about the Gdb-patches mailing list