This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
exp/1821: GDB prints structure members wrong if the names are x__0 in C .
- From: ramana dot radhakrishnan at codito dot com
- To: gdb-gnats at sources dot redhat dot com
- Cc: dk at artimi dot com, ac131313 at redhat dot com
- Date: 25 Nov 2004 04:00:35 -0000
- Subject: exp/1821: GDB prints structure members wrong if the names are x__0 in C .
- Reply-to: ramana dot radhakrishnan at codito dot com
>Number: 1821
>Category: exp
>Synopsis: GDB prints structure members wrong if the names are x__0 in C .
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Nov 25 04:08:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator: devnull@kma.eu.org
>Release: GDB 6.3.50 - 20041123 CVS head
>Organization:
>Environment:
GCC 3.3.2 Fedora Core 1 . binutils 2.14 . GDB 6.3.50 2004-11-23 CVS head. i686 target
>Description:
struct foo { double x__0, y__0, z__1; } bar;
int main(void) { return 0; }
When anyone attempts to print the value of bar using the print command, the output obtained is :
$1 = {::x(void) = 0, ::y(void) = 0, z = 0}
Problem occurs in gdb 5.3.90 , 6.1 Debian , 6.3.50 - 20041123 CVS head .
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.
>How-To-Repeat:
Howto repeat in GDB.
(gdb) b main
Breakpoint 1 at 0x8048374: file foo.c, line 9.
(gdb) r
Starting program: /home/ramana/a.out
Breakpoint 1, main () at foo.c:9
9 printf("blah");
(gdb) p bar
$1 = {::x(void) = 0, ::y(void) = 0, z = 0}
(gdb)
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: