Fixed stabs cplus_specific issue
authorSami Wagiaalla <swagiaal@redhat.com>
Mon, 9 Aug 2010 20:13:51 +0000 (20:13 +0000)
committerSami Wagiaalla <swagiaal@redhat.com>
Mon, 9 Aug 2010 20:13:51 +0000 (20:13 +0000)
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.

gdb/ChangeLog
gdb/stabsread.c
gdb/symtab.c

index aa4bd19e804bf4f0cb31ab72f3d1e14ea6903f50..d0522f83b6b3b9cecb23e8d9c607c02060248c6f 100644 (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
index 5f6b0042580716fe5f8d86715b0272b4be358ded..43b09f10ed4c8a21de55559efd9e924ca587f9da 100644 (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++;
 
index 5fbe58cf698dee8a4f0a01f0505546e61dedfdef..d43d573c6e17943e50575f47703f9ec55fd74aa6 100644 (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;