This is the mail archive of the 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: MI: getting qualified type name

On Thu, Apr 13, 2006 at 10:26:46AM -0700, Jim Ingham wrote:
> That's odd.  If I define some struct in a namespace myself, like:
> namespace bar
> {
>   struct whatever
>     {
>        int someval;
>     };
> };
> then -var-create lists the type as bar::whatever.  So it must be  
> something funny about how "string" is defined, rather than a general  
> bug or a decision to strip the namespace info.

It appears to be a bug involving typedefs.  Try adding "typedef
whatever zot" inside of namespace bar.

namespace bar
   struct whatever
        int someval;
   typedef whatever zot;

(gdb) interpreter-exec mi "-var-create - * b"
(gdb) interpreter-exec mi "-var-create - * c"

I don't know what compiler you're using, Vladimir, but in GCC 4.0.3
this appears to be a compiler bug.  The typedef gets emitted inside
main, not inside the namespace.  Same in 3.3.  Slightly different,
but similar problem in 4.1.

This is now GCC PR 27160.

> (Note, however, if you are using stabs, you'll never get the  
> namespace, since it isn't in the debug info.  You probably aren't  
> using stabs, but just to be clear...)

Actually, IIRC, it does but poorly?  Hmm, maybe not for this case.

Daniel Jacobowitz

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