This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
Re: c++/832: GDB doesn't know when types are defined within namespaces
- From: gson at nominum dot com (Andreas Gustafsson)
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 16 Apr 2003 02:08:00 -0000
- Subject: Re: c++/832: GDB doesn't know when types are defined within namespaces
- Reply-to: gson at nominum dot com (Andreas Gustafsson)
The following reply was made to PR c++/832; it has been noted by GNATS.
From: gson at nominum dot com (Andreas Gustafsson)
To: gdb-gnats at sources dot redhat dot com
Cc:
Subject: Re: c++/832: GDB doesn't know when types are defined within namespaces
Date: Tue, 15 Apr 2003 19:00:06 -0700 (PDT)
This bug may be more serious than it first seems. It's not just a
question of the user having to enter types without the namespace
qualifier - it can cause gdb to think objects are of a completely
different type than they actually are.
Suppose you define both a global "struct C" and a separate and
different "struct C" in a namespace "A", and you have a pointer "A::C *p"
pointing to an A::C object. If you then enter the command "print
*p" in gdb, it will produce garbage because it prints the A::C object
interpreted as a ::C object.
I'm currently trying to debug a program that links in two different
versions of the same library differentiated by means of namespaces,
and this bug makes it pretty much impossible.
--
Andreas Gustafsson, gson at nominum dot com