c++/488: vtable, RTTI, and namespaces don't work together

James Cone jcone@eservglobal.com
Thu Jul 6 07:28:00 GMT 2006


The following reply was made to PR c++/488; it has been noted by GNATS.

From: James Cone <jcone@eservglobal.com>
To: gdb-gnats@sources.redhat.com
Cc:  
Subject: Re: c++/488: vtable, RTTI, and namespaces don't work together
Date: Thu, 06 Jul 2006 19:26:39 +1200

 Proposed minimal patch, to cut the scope selector out of the RTTI type 
 name, if we think scope selectors are unsupported.
 
 --- cp-support.c.orig   Wed Jul  5 03:39:33 2006
 +++ cp-support.c        Wed Jul  5 23:45:38 2006
 @@ -812,6 +812,23 @@
     struct symbol * rtti_sym;
     struct type * rtti_type;
 
 +  if (!processing_has_namespace_info)
 +    {
 +      /* FIXME: If the class is declared inside a namespace,
 +       * there will be a scope selector in the name.  Ideally,
 +       * the grammar would recognise casts to names with scope
 +       * selectors, and the type lookup would work for them.
 +       * I can't work out how to fix the second of those problems
 +       * so this is a hack to make the debugger work for me,
 +       * in relation to pr/488.
 +       */
 +      const char *colon = strrchr(name, ':');
 +      if (NULL != colon && ':' == *colon)
 +        {
 +          name = colon+1;
 +        }
 +    }
 +
     rtti_sym = lookup_symbol (name, block, STRUCT_DOMAIN, NULL, NULL);
 
     if (rtti_sym == NULL)
 --- version.c.orig      Wed Jul  5 23:39:10 2006
 +++ version.c   Wed Jul  5 23:38:42 2006
 @@ -1,4 +1,4 @@
   #include "version.h"
 -const char version[] = "6.4";
 +const char version[] = "6.4-jc1";
   const char host_name[] = "sparc-sun-solaris2.9";
   const char target_name[] = "sparc-sun-solaris2.9";



More information about the Gdb-prs mailing list