PR symtab/17591

gdb/ChangeLog:

	PR symtab/17591
	* dwarf2read.c (find_slot_in_mapped_hash): Use cp_remove_params
	to strip parameters.
This commit is contained in:
Doug Evans 2014-12-02 16:24:37 -08:00
parent 422b9917ce
commit 72998fb37a
2 changed files with 13 additions and 13 deletions

View file

@ -1,3 +1,9 @@
2014-12-02 Doug Evans <dje@google.com>
PR symtab/17591
* dwarf2read.c (find_slot_in_mapped_hash): Use cp_remove_params
to strip parameters.
2014-12-02 Doug Evans <dje@google.com>
* dwarf2read.c (peek_die_abbrev): Improve error message text.

View file

@ -2918,22 +2918,16 @@ find_slot_in_mapped_hash (struct mapped_index *index, const char *name,
{
/* NAME is already canonical. Drop any qualifiers as .gdb_index does
not contain any. */
const char *paren = NULL;
/* Need to handle "(anonymous namespace)". */
if (*name != '(')
paren = strchr (name, '(');
if (paren)
if (strchr (name, '(') != NULL)
{
char *dup;
char *without_params = cp_remove_params (name);
dup = xmalloc (paren - name + 1);
memcpy (dup, name, paren - name);
dup[paren - name] = 0;
make_cleanup (xfree, dup);
name = dup;
if (without_params != NULL)
{
make_cleanup (xfree, without_params);
name = without_params;
}
}
}