This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
Re: c++/1146: gdb cannot set breakpoints within subclasses of classes
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 18 Mar 2003 17:18:00 -0000
- Subject: Re: c++/1146: gdb cannot set breakpoints within subclasses of classes
- Reply-to: Daniel Jacobowitz <drow at mvista dot com>
The following reply was made to PR c++/1146; it has been noted by GNATS.
From: Daniel Jacobowitz <drow at mvista dot com>
To: thor at math dot tu-berlin dot de
Cc: gdb-gnats at sources dot redhat dot com
Subject: Re: c++/1146: gdb cannot set breakpoints within subclasses of classes
Date: Tue, 18 Mar 2003 12:05:55 -0500
On Tue, Mar 18, 2003 at 01:12:15PM -0000, thor at math dot tu-berlin dot de wrote:
>
> >Number: 1146
> >Category: c++
> >Synopsis: gdb cannot set breakpoints within subclasses of classes
> >Confidential: no
> >Severity: serious
> >Priority: medium
> >Responsible: unassigned
> >State: open
> >Class: sw-bug
> >Submitter-Id: net
> >Arrival-Date: Tue Mar 18 13:18:01 UTC 2003
> >Closed-Date:
> >Last-Modified:
> >Originator: Thomas Richter
> >Release: GNU gdb 5.3
> >Organization:
> >Environment:
> Linux cleopatra 2.4.18-4GB #1 Wed Mar 27 13:57:05 UTC 2002 i686 unknown
> >Description:
> If a class contains the definition and declaration of a sub-class, then gdb cannot set breakpoints within member
> functions of this subclass.
> >How-To-Repeat:
> Save the following file as "foo.cpp":
> /* snip */
> #include <cstdio>
>
> class A {
> public:
> class B {
> public:
> void hello(void);
> } b;
> };
>
> void A::B::hello(void)
> {
> printf("Hello.\n");
> }
Yes, this is an unfortunate known problem. I'm waiting for more of the
namespace support patches to be committed before I address nested
classes again.
> Hence, gdb tries erraneously to resolve A::B as a member, and not as a subclass.
> >Fix:
> not known
You can breakpoint on 'A::B::hello(void)' as a workaround. Try that?
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer