Fixed stabs cplus_specific issue

2010-08-09  Sami Wagiaalla  <swagiaal@redhat.com>

	* symtab.c (symbol_get_demangled_name): Remove assertion and
	return NULL when language_specific.cplus_specific is not initialized.
	* stabsread.c (define_symbol): Set the name before calling
	cp_scan_for_anonymous_namespaces.
This commit is contained in:
Sami Wagiaalla 2010-08-09 20:13:51 +00:00
parent 776167e8fa
commit 45c58896fc
3 changed files with 15 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2010-08-09 Sami Wagiaalla <swagiaal@redhat.com>
* symtab.c (symbol_get_demangled_name): Remove assertion and
return NULL when language_specific.cplus_specific is not initialized.
* stabsread.c (define_symbol): Set the name before calling
cp_scan_for_anonymous_namespaces.
2010-08-09 Sami Wagiaalla <swagiaal@redhat.com>
* symtab.h: Renamed SYMBOL_INIT_LANGUAGE_SPECIFIC to

View File

@ -712,7 +712,6 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
memcpy (name, string, p - string);
name[p - string] = '\0';
new_name = cp_canonicalize_string (name);
cp_scan_for_anonymous_namespaces (sym);
}
if (new_name != NULL)
{
@ -721,6 +720,10 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
}
else
SYMBOL_SET_NAMES (sym, string, p - string, 1, objfile);
if (SYMBOL_LANGUAGE (sym) == language_cplus)
cp_scan_for_anonymous_namespaces (sym);
}
p++;

View File

@ -382,8 +382,10 @@ symbol_get_demangled_name (const struct general_symbol_info *gsymbol)
{
if (gsymbol->language == language_cplus)
{
gdb_assert (gsymbol->language_specific.cplus_specific != NULL);
return gsymbol->language_specific.cplus_specific->demangled_name;
if (gsymbol->language_specific.cplus_specific != NULL)
return gsymbol->language_specific.cplus_specific->demangled_name;
else
return NULL;
}
else
return gsymbol->language_specific.mangled_lang.demangled_name;