aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1993-11-17 04:24:34 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1993-11-17 04:24:34 +0000
commitd47a7f52cffd062492c0e84af9a7736a2454f760 (patch)
treeb1c8d91a56552a5bb8fe9be7a6fd27cde4300c58 /gdb/symtab.c
parentdfbaacfa1fbbc5c9778c4c7eb8e6749e799909c6 (diff)
downloadgdb-d47a7f52cffd062492c0e84af9a7736a2454f760.zip
gdb-d47a7f52cffd062492c0e84af9a7736a2454f760.tar.gz
gdb-d47a7f52cffd062492c0e84af9a7736a2454f760.tar.bz2
* 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.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 157d2da..2d74466 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -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);