From: "Dave Korn" <dk@artimi.com>
To: <ramana.radhakrishnan@codito.com>, <devnull@kma.eu.org>
Cc: <gdb@sources.redhat.com>
Subject: RE: Struct fields printed in a strange way
Date: Fri, 26 Nov 2004 17:26:00 -0000 [thread overview]
Message-ID: <NUTMEGaVupK0OVYqSdv000000a3@NUTMEG.CAM.ARTIMI.COM> (raw)
In-Reply-To: <32856.210.18.132.234.1101319515.squirrel@webmail.codito.com>
> -----Original Message-----
> From: gdb-owner On Behalf Of Ramana Radhakrishnan
> Sent: 24 November 2004 18:05
> > gdb seems slightly confused when the name of a struct field is
> > suffixed with "__0".
> >
> > $ cat foo.c
> > struct foo { double x__0, y__0, z__1; } bar;
> >
> > int main(void) { return 0; }
> >
> > $ gcc-3.3.2 -Wall -ansi -pedantic -g3 foo.c
>
> I was able to repeat this with
>
> [ramana@numenor gdb]$ gcc -v
> gcc version 3.3.2 20031022 (Red Hat Linux 3.3.2-1)
>
> and
>
>
> GNU gdb 6.3.50_2004-11-23-cvs
Also confirmed on cygwin with "gcc (GCC) 3.3.3 (cygwin special)" and
"GNU gdb 2003-09-20-cvs (cygwin-special)"
So it's a fairly longstanding bug.
> > (gdb) show language
> > The current source language is "auto; currently c".
> >
> > Why is x__0 changed to ::x(void)? Is the "__0" suffix
> reserved in gdb?
>
>
> This appears to be due to the way in which the structs are handled in
> c-valprint.c . The demangler gets called here because the function
> c_val_print prints the structure fields using the printer from the c++
> language implementation. Should there not be a C equivalent for this ?
> This btw is from yesterday's CVS sources.
That's definitely bad logic. I had noticed that even if you explicitly
say "set lang c", it _still_ tries to demangle the name. Anyone going to
file a bugzilla then?
cheers,
DaveK
--
Can't think of a witty .sigline today....
next prev parent reply other threads:[~2004-11-24 18:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-24 17:47 Grumble
2004-11-24 17:53 ` Ramana Radhakrishnan
2004-11-26 17:26 ` Dave Korn [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-11-18 21:22 Grumble
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=NUTMEGaVupK0OVYqSdv000000a3@NUTMEG.CAM.ARTIMI.COM \
--to=dk@artimi.com \
--cc=devnull@kma.eu.org \
--cc=gdb@sources.redhat.com \
--cc=ramana.radhakrishnan@codito.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).