This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
Re: gdb/57
- To: nobody at sources dot redhat dot com
- Subject: Re: gdb/57
- From: Angela Marie Thomas <angela at foam dot wonderslug dot com>
- Date: 12 Oct 2001 20:38:01 -0000
- Cc: gdb-prs at sources dot redhat dot com,
- Reply-To: Angela Marie Thomas <angela at foam dot wonderslug dot com>
The following reply was made to PR gdb/57; it has been noted by GNATS.
From: Angela Marie Thomas <angela@foam.wonderslug.com>
To: stu.whitman@emergent-it.com
Cc: gdb-gnats@sources.redhat.com, gdb-prs@sources.redhat.com
Subject: Re: gdb/57
Date: Fri, 12 Oct 2001 13:25:14 -0700
> Description:
> In the following example two classes have a nested class with the same
> name. Gdb incorrectly prints the contents of the nested class.
Have you tried using dwarf-2 debugging? My understanding is
that dwarf-2 debugging is generally preferred for C++ debugging.
In a couple of quick tests, compiling your source with -gdwarf-2
produced what look like expected results. The following is using
gcc 2.95.1 and gdb 4.18. I have had similar results with gcc 2.93,
gcc 2.96 and gdb 5.0.
(gdb) b main
Breakpoint 1 at 0x200127c: file main.cc, line 33.
(gdb) run
Starting program: /tmp/main.gdwarf-2
Breakpoint 1, main () at main.cc:33
33 A a;
(gdb) n
34 B b;
(gdb) n
35 }
(gdb) ptype a.d_i
type = class I {
public:
int d_v;
I & operator=(A::I const &);
I(A::I const &);
I(void);
} *
(gdb) ptype b.d_i
type = class I {
public:
double d_v;
I & operator=(B::I const &);
I(B::I const &);
I(void);
} *
(gdb)
--
Angela Marie Thomas
angela@wonderslug.com