2002-10-23 Elena Zannoni <ezannoni@redhat.com>
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>
Wed, 23 Oct 2002 18:16:44 +0000 (18:16 +0000)
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>
Wed, 23 Oct 2002 18:16:44 +0000 (18:16 +0000)
* symtab.c (symbol_init_language_specific): New function.
* symtab.h (SYMBOL_INIT_LANGUAGE_SPECIFIC): Simplify macro, by
turning most of it into a function.
(symbol_init_language_specific): Export.

gdb/ChangeLog
gdb/symtab.c
gdb/symtab.h

index bb555e18117b8b4b1abdea9447e4e64bb621464a..c922b3b106dcf406b3fcd63f3502327cc5de2abe 100644 (file)
@@ -1,3 +1,10 @@
+2002-10-23  Elena Zannoni  <ezannoni@redhat.com>
+
+       * symtab.c (symbol_init_language_specific): New function.
+       * symtab.h (SYMBOL_INIT_LANGUAGE_SPECIFIC): Simplify macro, by
+       turning most of it into a function.
+       (symbol_init_language_specific): Export.
+
 2002-10-23  David Carlton  <carlton@math.stanford.edu>
 
        * dwarf2read.c (dwarf_tag_name): Add DWARF 3 names.
index a4322926e2f8d5e6030dc3cf4d41c671049f8f57..7b70aa7d13c790ecd563d4ad2c7430987a43013b 100644 (file)
@@ -385,6 +385,33 @@ gdb_mangle_name (struct type *type, int method_id, int signature_id)
 }
 
 \f
+/* Initialize the language dependent portion of a symbol
+   depending upon the language for the symbol. */
+void
+symbol_init_language_specific (struct general_symbol_info *gsymbol,
+                              enum language language)
+{
+  gsymbol->language = language;
+  if (gsymbol->language == language_cplus
+      || gsymbol->language == language_java)
+    {
+      gsymbol->language_specific.cplus_specific.demangled_name = NULL;
+    }
+  else if (gsymbol->language == language_objc)
+    {
+      gsymbol->language_specific.objc_specific.demangled_name = NULL;
+    }
+  /* OBSOLETE else if (SYMBOL_LANGUAGE (symbol) == language_chill) */
+  /* OBSOLETE   { */
+  /* OBSOLETE     SYMBOL_CHILL_DEMANGLED_NAME (symbol) = NULL; */
+  /* OBSOLETE   } */
+  else
+    {
+      memset (&gsymbol->language_specific, 0,
+             sizeof (gsymbol->language_specific));
+    }
+}
+
 /* Initialize a symbol's mangled name.  */
 
 /* Try to initialize the demangled name for a symbol, based on the
index b84cac69ced8fbfc9c5251e87703751030c31cb3..38637475c04aa1bf8b11a297cbce87ca332c5272 100644 (file)
@@ -139,32 +139,12 @@ extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, asection *);
 #define SYMBOL_CPLUS_DEMANGLED_NAME(symbol)    \
   (symbol)->ginfo.language_specific.cplus_specific.demangled_name
 
-/* Macro that initializes the language dependent portion of a symbol
+/* Initializes the language dependent portion of a symbol
    depending upon the language for the symbol. */
-
-#define SYMBOL_INIT_LANGUAGE_SPECIFIC(symbol,language)                 \
-  do {                                                                 \
-    SYMBOL_LANGUAGE (symbol) = language;                               \
-    if (SYMBOL_LANGUAGE (symbol) == language_cplus                     \
-       || SYMBOL_LANGUAGE (symbol) == language_java                    \
-       )                                                               \
-      {                                                                        \
-       SYMBOL_CPLUS_DEMANGLED_NAME (symbol) = NULL;                    \
-      }                                                                        \
-    else if (SYMBOL_LANGUAGE (symbol) == language_objc)                        \
-      {                                                                        \
-       SYMBOL_OBJC_DEMANGLED_NAME (symbol) = NULL;                     \
-      }                                                                        \
-    /* OBSOLETE else if (SYMBOL_LANGUAGE (symbol) == language_chill) */ \
-    /* OBSOLETE   { */                                                 \
-    /* OBSOLETE     SYMBOL_CHILL_DEMANGLED_NAME (symbol) = NULL; */    \
-    /* OBSOLETE   } */                                                 \
-    else                                                               \
-      {                                                                        \
-       memset (&(symbol)->ginfo.language_specific, 0,                  \
-               sizeof ((symbol)->ginfo.language_specific));            \
-      }                                                                        \
-  } while (0)
+#define SYMBOL_INIT_LANGUAGE_SPECIFIC(symbol,language) \
+  (symbol_init_language_specific (&(symbol)->ginfo, (language)))
+extern void symbol_init_language_specific (struct general_symbol_info *symbol,
+                                          enum language language);
 
 #define SYMBOL_INIT_DEMANGLED_NAME(symbol,obstack) \
   (symbol_init_demangled_name (&symbol->ginfo, (obstack)))