public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Struct fields printed in a strange way
@ 2004-11-18 21:22 Grumble
  0 siblings, 0 replies; 4+ messages in thread
From: Grumble @ 2004-11-18 21:22 UTC (permalink / raw)
  To: gdb

Hello all,

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

$ gdb a.out
GNU gdb 6.0-2mdk (Mandrake Linux)
Copyright 2003 Free Software Foundation, Inc.
[...]
This GDB was configured as "i586-mandrake-linux-gnu"...Using host 
libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) print bar
$1 = {::x(void) = 0, ::y(void) = 0, z__1 = 0}

(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?

-- 
Regards, Grumble

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Struct fields printed in a strange way
@ 2004-11-24 17:47 Grumble
  2004-11-24 17:53 ` Ramana Radhakrishnan
  0 siblings, 1 reply; 4+ messages in thread
From: Grumble @ 2004-11-24 17:47 UTC (permalink / raw)
  To: gdb

Hello all,

[ Apologies: I forgot to set the Reply-To field the first time.
Please re-send your reply if it was lost inside the bit bucket. ]

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

$ gdb a.out
GNU gdb 6.0-2mdk (Mandrake Linux)
Copyright 2003 Free Software Foundation, Inc.
[...]
This GDB was configured as "i586-mandrake-linux-gnu"...Using host
libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) print bar
$1 = {::x(void) = 0, ::y(void) = 0, z__1 = 0}

(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?

-- 
Regards, Grumble

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-11-24 18:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-18 21:22 Struct fields printed in a strange way Grumble
2004-11-24 17:47 Grumble
2004-11-24 17:53 ` Ramana Radhakrishnan
2004-11-26 17:26   ` Dave Korn

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).