This is the mail archive of the gdb-prs@sourceware.org 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: exp/2070: gdb doesn't resolve namespace when print expression


The following reply was made to PR exp/2070; it has been noted by GNATS.

From: Daniel Jacobowitz <drow@false.org>
To: "Yan, Michael" <myan@microstrategy.com>
Cc: gdb-gnats@sources.redhat.com, myan@gmail.com
Subject: Re: exp/2070: gdb doesn't resolve namespace when print expression
Date: Thu, 19 Jan 2006 12:49:57 -0500

 On Thu, Jan 19, 2006 at 12:25:34PM -0500, Yan, Michael wrote:
 > g++ (GCC) 3.2.3
 
 I believe that version of G++ does not emit debug information for
 namespaces.  GDB does the best it can in the absence of useful
 information, but there are some severe limitations anyway.
 
 > > (gdb) p *(NBase::Frog *) 0x501010
 > > No symbol "NBase" in current context.
 
 With GCC 4.0.3 I get:
 
 (gdb) p *(NBase::Frog *) 0x501010
 A syntax error in expression, near `) 0x501010'.
 (gdb) p *(Frog *) 0x501010
 A syntax error in expression, near `) 0x501010'.
 (gdb) p *('NBase::Frog' *) 0x501010
 Cannot access memory at address 0x501010
 
 The first syntax error is a bug in GDB; I believe there's an open PR
 about it.
 
 The second error is expected when I am stopped in main(), because there
 is no Frog in this namespace.  When stopped in NBase::Frog::Frog() it's
 a bug in GDB (which I believe there's another bug report about also) -
 GDB finds NBase::Frog::Frog() instead of NBase::Frog and gets confused.
 
 For now I can only recommend the third form, and hopefully someone will
 take another stab at the first two bugs soon.
 
 -- 
 Daniel Jacobowitz
 CodeSourcery


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