This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
Re: symtab/213: Type confusion with excluded include files (stabs)
- From: "Mattias Engdegård" <mattias at virtutech dot se>
- To: mec at shout dot net
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 19 Aug 2003 19:58:00 -0000
- Subject: Re: symtab/213: Type confusion with excluded include files (stabs)
- Reply-to: "Mattias Engdegård" <mattias at virtutech dot se>
The following reply was made to PR symtab/213; it has been noted by GNATS.
From: "=?ISO-8859-1?Q?Mattias Engdeg=E5rd?=" <mattias@virtutech.se>
To: mec@shout.net, gdb-prs@sources.redhat.com, gustav@virtutech.se,
mattias@virtutech.se, mec@shout.net, gdb-gnats@sources.redhat.com
Cc: gdb-prs@sources.redhat.com, gustav@virtutech.se, mec@shout.net
Subject: Re: symtab/213: Type confusion with excluded include files (stabs)
Date: Tue, 19 Aug 2003 21:51:49 +0200
>The test program here violates the One Definition Rule. I don't know
>if the ODR is part of the ISO standard for C; I will go find that
>out.
The only ODR I know of talks about variables, not types. It is
perfectly legal to define types with the same name in different
translation units, and they do not have to match. (See for instance
C99 6.7.2.3.4 and 6.7.2.1.7). The variables "a" and "b" have different
names and are not affected by ODR.
>With -gdwarf-2, gdb correctly prints the types of both "a" and "b".
Correct, DWARF does not have this problem.
The migration to DWARF is slowly making this bug irrelevant, but Stabs
is still used (especially under Solaris), and the size of DWARF debug
info is still orders of magnitude larger than Stabs (partly because it
lacks the Stabs mechanism to elide repeated file includes), which
forces Stabs for some projects.