mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-07 07:58:54 +08:00
Modified Files:
symtab.c * symtab.c: fix a bug in gdb_mangle_name, to get mangled name right
This commit is contained in:
@ -258,13 +258,13 @@ gdb_mangle_name (type, i, j)
|
|||||||
char *field_name = TYPE_FN_FIELDLIST_NAME (type, i);
|
char *field_name = TYPE_FN_FIELDLIST_NAME (type, i);
|
||||||
char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
|
char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
|
||||||
char *newname = type_name_no_tag (type);
|
char *newname = type_name_no_tag (type);
|
||||||
int is_constructor = newname != NULL && STREQ (field_name, newname);
|
int is_constructor = (physname[0]=='_' && physname[1]=='_');
|
||||||
int is_destructor = is_constructor && DESTRUCTOR_PREFIX_P (physname);
|
int is_destructor = DESTRUCTOR_PREFIX_P (physname);
|
||||||
/* Need a new type prefix. */
|
/* Need a new type prefix. */
|
||||||
char *const_prefix = method->is_const ? "C" : "";
|
char *const_prefix = method->is_const ? "C" : "";
|
||||||
char *volatile_prefix = method->is_volatile ? "V" : "";
|
char *volatile_prefix = method->is_volatile ? "V" : "";
|
||||||
char buf[20];
|
char buf[20];
|
||||||
#ifndef GCC_MANGLE_BUG
|
#ifdef GCC_MANGLE_BUG
|
||||||
int len = newname == NULL ? 0 : strlen (newname);
|
int len = newname == NULL ? 0 : strlen (newname);
|
||||||
|
|
||||||
if (is_destructor)
|
if (is_destructor)
|
||||||
@ -308,6 +308,7 @@ gdb_mangle_name (type, i, j)
|
|||||||
as something starting with `::' rather than `classname::'. */
|
as something starting with `::' rather than `classname::'. */
|
||||||
if (newname != NULL)
|
if (newname != NULL)
|
||||||
strcat (mangled_name, newname);
|
strcat (mangled_name, newname);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
char *opname;
|
char *opname;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user