This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/832: GDB doesn't know when types are defined within namespaces


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]