* Rename remote-es1800.c to remote-es.c
[deliverable/binutils-gdb.git] / gdb / minsyms.c
index 66ac9228542bb4f0f342d06e6ff125be2f8366e7..4b48e2e9c8f075bad475aad3790db303ebde0cc3 100644 (file)
@@ -264,13 +264,9 @@ prim_record_minimal_symbol (name, address, ms_type)
     }
   msymbol = &msym_bunch -> contents[msym_bunch_index];
   SYMBOL_NAME (msymbol) = (char *) name;
-  /* Note that SYMBOL_LANGUAGE and SYMBOL_DEMANGLED_NAME are not initialized
-     to their final values until the minimal symbols are actually added to
-     the minimal symbol table.  We just set them to a known state here so
-     random values won't confuse anyone debugging the debugger. */
-  SYMBOL_LANGUAGE (msymbol) = language_unknown;
-  SYMBOL_DEMANGLED_NAME (msymbol) = NULL;
+  SYMBOL_INIT_LANGUAGE_SPECIFIC (msymbol, language_unknown);
   SYMBOL_VALUE_ADDRESS (msymbol) = address;
+  SYMBOL_SECTION (msymbol) = -1;
   MSYMBOL_TYPE (msymbol) = ms_type;
   /* FIXME:  This info, if it remains, needs its own field.  */
   MSYMBOL_INFO (msymbol) = NULL; /* FIXME! */
@@ -282,11 +278,12 @@ prim_record_minimal_symbol (name, address, ms_type)
    and pass it a NULL info pointer value if info is not needed? */
 
 void
-prim_record_minimal_symbol_and_info (name, address, ms_type, info)
+prim_record_minimal_symbol_and_info (name, address, ms_type, info, section)
      const char *name;
      CORE_ADDR address;
      enum minimal_symbol_type ms_type;
      char *info;
+     int section;
 {
   register struct msym_bunch *new;
   register struct minimal_symbol *msymbol;
@@ -300,13 +297,9 @@ prim_record_minimal_symbol_and_info (name, address, ms_type, info)
     }
   msymbol = &msym_bunch -> contents[msym_bunch_index];
   SYMBOL_NAME (msymbol) = (char *) name;
-  /* Note that SYMBOL_LANGUAGE and SYMBOL_DEMANGLED_NAME are not initialized
-     to their final values until the minimal symbols are actually added to
-     the minimal symbol table.  We just set them to a known state here so
-     random values won't confuse anyone debugging the debugger. */
-  SYMBOL_LANGUAGE (msymbol) = language_unknown;
-  SYMBOL_DEMANGLED_NAME (msymbol) = NULL;
+  SYMBOL_INIT_LANGUAGE_SPECIFIC (msymbol, language_unknown);
   SYMBOL_VALUE_ADDRESS (msymbol) = address;
+  SYMBOL_SECTION (msymbol) = section;
   MSYMBOL_TYPE (msymbol) = ms_type;
   /* FIXME:  This info, if it remains, needs its own field.  */
   MSYMBOL_INFO (msymbol) = info; /* FIXME! */
@@ -539,8 +532,7 @@ install_minimal_symbols (objfile)
       SYMBOL_VALUE_ADDRESS (&msymbols[mcount]) = 0;
       MSYMBOL_INFO (&msymbols[mcount]) = NULL;
       MSYMBOL_TYPE (&msymbols[mcount]) = mst_unknown;
-      SYMBOL_LANGUAGE (&msymbols[mcount]) = language_unknown;
-      SYMBOL_DEMANGLED_NAME (&msymbols[mcount]) = NULL;
+      SYMBOL_INIT_LANGUAGE_SPECIFIC (&msymbols[mcount], language_unknown);
 
       /* Attach the minimal symbol table to the specified objfile.
         The strings themselves are also located in the symbol_obstack
@@ -554,24 +546,7 @@ install_minimal_symbols (objfile)
 
       for ( ; mcount-- > 0 ; msymbols++)
        {
-         if (SYMBOL_LANGUAGE (msymbols) == language_auto)
-           {
-             demangled_name = cplus_demangle (SYMBOL_NAME (msymbols),
-                                              DMGL_PARAMS | DMGL_ANSI);
-             if (demangled_name == NULL)
-               {
-                 SYMBOL_LANGUAGE (msymbols) = language_unknown;
-               }
-             else
-               {
-                 SYMBOL_LANGUAGE (msymbols) = language_cplus;
-                 SYMBOL_DEMANGLED_NAME (msymbols) =
-                   obsavestring (demangled_name, strlen (demangled_name),
-                                 &objfile->symbol_obstack);
-                                         
-                 free (demangled_name);
-               }
-           }
+         SYMBOL_INIT_DEMANGLED_NAME (msymbols, &objfile->symbol_obstack);
        }
     }
 }
This page took 0.024788 seconds and 4 git commands to generate.