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: Stuart Whitman <stu dot whitman at emergent-it dot com>
- Date: 15 Oct 2001 13:28:01 -0000
- Cc: gdb-prs at sources dot redhat dot com,
- Reply-To: Stuart Whitman <stu dot whitman at emergent-it dot com>
The following reply was made to PR gdb/57; it has been noted by GNATS.
From: Stuart Whitman <stu.whitman@emergent-it.com>
To: angela@wonderslug.com
Cc: stu.whitman@dlva.emergent-IT.com,
gdb-gnats@sources.redhat.com, gdb-prs@sources.redhat.com
Subject: Re: gdb/57
Date: Mon, 15 Oct 2001 09:25:47 -0400
Thanks Angela!
It does appear to work. I will change our makefiles to use this option.
Quick question, if this is the preferred debugging format for C++, why
is it not the default when "g++ -g" is invoked?
Stu
Angela Marie Thomas wrote:
>
> > 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
--
Stuart Whitman Emergent Information Technologies, Inc.
703 645 8445 Metro Place
Fax: 703 641 7172 2600 Park Tower Drive, Suite 800
Vienna, VA 22180