This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: incomplete enums in classes
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Stephane Chauveau <s dot chauveau at chello dot nl>
- Cc: gdb at sources dot redhat dot com
- Date: Mon, 19 Aug 2002 11:56:38 -0400
- Subject: Re: incomplete enums in classes
- References: <20020603225230.A21363@simak.arnhem.chello.nl>
On Mon, Jun 03, 2002 at 10:52:30PM +0200, Stephane Chauveau wrote:
>
> I found a problem in gdb 5.2 when debugging g++ programs.
> Enum types declared without a name within a class are incomplete.
>
> Consider the following program:
>
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>
> enum TYPE1 { V1 } ;
> typedef enum { V2 } TYPE2 ;
> class FOO {
> public:
>
> enum TYPE3 { V3 } ; typedef enum { V4 } TYPE4 ;
> int v ; } ;
>
> enum TYPE1 a ; TYPE2 b ; enum FOO::TYPE3 c ; FOO::TYPE4 d ;
> int
> main(void)
> {
> a = V1 ; b = V2 ; c = FOO::V3 ; d = FOO::V4 ; }
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> (gdb) p d
> $4 = <incomplete type>
This is a bug in GCC. It only shows up when using stabs debug
information. Witness:
34 GSYM 0 9 00000000 1441 a:G(1,1)
35 GSYM 0 9 00000000 1450 b:G(1,2)
36 GSYM 0 9 00000000 1459 c:G(1,3)
37 GSYM 0 9 00000000 1468 d:G(1,13)=xeTYPE4:
"x" is the cross-reference descriptor; "e" implies an enum type; named
"TYPE4". There are no other references to TYPE4 in the file. GCC
failed to emit debug information for the enum.
You may want to report this to GCC.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer