From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
To: "'Jan Kratochvil'" <jan.kratochvil@redhat.com>
Cc: <gdb-patches@sourceware.org>
Subject: RE: [RFA] PR 11530: Fix and test case
Date: Fri, 30 Apr 2010 13:12:00 -0000 [thread overview]
Message-ID: <000301cae866$b0cfff50$126ffdf0$@muller@ics-cnrs.unistra.fr> (raw)
In-Reply-To: <20100430081959.GB12043@host0.dyn.jankratochvil.net>
> -----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
next prev parent reply other threads:[~2010-04-30 13:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-29 21:50 Pierre Muller
2010-04-30 8:20 ` Jan Kratochvil
2010-04-30 11:08 ` Joseph S. Myers
2010-04-30 13:12 ` Pierre Muller [this message]
[not found] ` <15700.946111656$1272633144@news.gmane.org>
2010-04-30 17:29 ` Tom Tromey
2010-05-05 21:44 ` Pierre Muller
[not found] ` <28104.8831450336$1273095904@news.gmane.org>
2010-05-07 17:45 ` Tom Tromey
[not found] <36245.8778698512$1272577829@news.gmane.org>
2010-04-30 17:26 ` Tom Tromey
2010-05-05 22:11 ` Pierre Muller
[not found] ` <1723.54181199825$1273097500@news.gmane.org>
2010-05-07 17:45 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='000301cae866$b0cfff50$126ffdf0$@muller@ics-cnrs.unistra.fr' \
--to=pierre.muller@ics-cnrs.unistra.fr \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox