+2019-06-10 Tom de Vries <tdevries@suse.de>
+
+ PR symtab/24545
+ * symtab.c (struct demangled_name_entry): Add language field.
+ (symbol_set_names): Revert "[gdb/symtab] Fix language of duplicate
+ static minimal symbol". Set and use language field.
+
2019-06-10 Tom Tromey <tromey@adacore.com>
* ada-lang.c (_initialize_ada_language): Update help text.
struct demangled_name_entry
{
const char *mangled;
+ ENUM_BITFIELD(language) language : LANGUAGE_BITS;
char demangled[1];
};
else
linkage_name_copy = linkage_name;
- /* Set the symbol language. */
- char *demangled_name_ptr
- = symbol_find_demangled_name (gsymbol, linkage_name_copy);
- gdb::unique_xmalloc_ptr<char> demangled_name (demangled_name_ptr);
-
entry.mangled = linkage_name_copy;
slot = ((struct demangled_name_entry **)
htab_find_slot (per_bfd->demangled_names_hash.get (),
|| (gsymbol->language == language_go
&& (*slot)->demangled[0] == '\0'))
{
+ char *demangled_name_ptr
+ = symbol_find_demangled_name (gsymbol, linkage_name_copy);
+ gdb::unique_xmalloc_ptr<char> demangled_name (demangled_name_ptr);
int demangled_len = demangled_name ? strlen (demangled_name.get ()) : 0;
/* Suppose we have demangled_name==NULL, copy_name==0, and
strcpy (mangled_ptr, linkage_name_copy);
(*slot)->mangled = mangled_ptr;
}
+ (*slot)->language = gsymbol->language;
if (demangled_name != NULL)
- strcpy ((*slot)->demangled, demangled_name.get());
+ strcpy ((*slot)->demangled, demangled_name.get ());
else
(*slot)->demangled[0] = '\0';
}
+ else if (gsymbol->language == language_unknown
+ || gsymbol->language == language_auto)
+ gsymbol->language = (*slot)->language;
gsymbol->name = (*slot)->mangled;
if ((*slot)->demangled[0] != '\0')