* symtab.c (gdb_mangle_name): Only assume that the physname is
authorJim Kingdon <jkingdon@engr.sgi.com>
Wed, 17 Nov 1993 04:24:34 +0000 (04:24 +0000)
committerJim Kingdon <jkingdon@engr.sgi.com>
Wed, 17 Nov 1993 04:24:34 +0000 (04:24 +0000)
the entire mangled name if it looks like the mangled name of a
constructor.  Needed for testsuite to work with GCC 2.4.5.

gdb/ChangeLog
gdb/symtab.c

index cb88933eef3e42f72cf3d6a6039a82c8f65d209e..96c9179ca35981e16fba8a96ebfa7cb5aa36fbd8 100644 (file)
@@ -15,10 +15,9 @@ Tue Nov 16 17:15:03 1993  Stu Grossman  (grossman at cygnus.com)
 
 Tue Nov 16 13:33:47 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
 
-       * symtab.c (gdb_mangle_name): If we detect something as a
-       constructor because the field name equals the class name, the
-       physname is just the args, not the whole mangled name.  Needed for
-       testsuite to work with GCC 2.4.5.
+       * symtab.c (gdb_mangle_name): Only assume that the physname is
+       the entire mangled name if it looks like the mangled name of a
+       constructor.  Needed for testsuite to work with GCC 2.4.5.
 
        * a68v-nat.c: Replace with new version from Troy Rollo.  The
        version I am replacing appears to be an old copy of sun3-nat.c.
index 157d2dab62c1a4b93033cfcb4c7a0fc30b20e46a..2d74466b34015be6779ed75edada2efa040b4f8b 100644 (file)
@@ -260,6 +260,11 @@ gdb_mangle_name (type, i, j)
   char *field_name = TYPE_FN_FIELDLIST_NAME (type, i);
   char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
   char *newname = type_name_no_tag (type);
+
+  /* Does the form of physname indicate that it is the full mangled name
+     of a constructor (not just the args)?  */
+  int is_full_physname_constructor;
+
   int is_constructor;
   int is_destructor = DESTRUCTOR_PREFIX_P (physname);
   /* Need a new type prefix.  */
@@ -268,17 +273,19 @@ gdb_mangle_name (type, i, j)
   char buf[20];
   int len = (newname == NULL ? 0 : strlen (newname));
 
-  is_constructor = newname && STREQ(field_name, newname);
-  if (!is_constructor)
-    is_constructor = (physname[0]=='_' && physname[1]=='_' && 
-               (isdigit(physname[2]) || physname[2]=='Q' || physname[2]=='t'));
-  if (!is_constructor)
-    is_constructor = (strncmp(physname, "__ct", 4) == 0); 
+  is_full_physname_constructor = 
+    ((physname[0]=='_' && physname[1]=='_' && 
+      (isdigit(physname[2]) || physname[2]=='Q' || physname[2]=='t'))
+     || (strncmp(physname, "__ct", 4) == 0));
+
+  is_constructor =
+    is_full_physname_constructor || (newname && STREQ(field_name, newname));
+
   if (!is_destructor)
     is_destructor = (strncmp(physname, "__dt", 4) == 0); 
 
 #ifndef GCC_MANGLE_BUG
-  if (is_destructor || is_constructor)
+  if (is_destructor || is_full_physname_constructor)
     {
       mangled_name = (char*) xmalloc(strlen(physname)+1);
       strcpy(mangled_name, physname);
This page took 0.033984 seconds and 4 git commands to generate.