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

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

index e922e58312949dd9131cff6e84639560ca8c4a85..33ab94afa0df5b16da5cb034befa07dcfc967fa8 100644 (file)
@@ -1,3 +1,10 @@
+2002-10-23  Elena Zannoni  <ezannoni@redhat.com>
+
+       * symtab.c (symbol_demangled_name): New function.
+       * symtab.h (SYMBOL_DEMANGLED_NAME): Simplify macro, by
+       turning most of it into a function.
+       (symbol_demangled_name): Export.
+
 2002-10-23  Michael Snyder  <msnyder@redhat.com>
 
        * valops.c (value_of_local): Restore quotes in error message.
index 7b70aa7d13c790ecd563d4ad2c7430987a43013b..3ae4f2a13119a13f21f02612c461968c727b5c2a 100644 (file)
@@ -488,7 +488,24 @@ symbol_init_demangled_name (struct general_symbol_info *gsymbol,
 #endif
 }
 
+/* Return the demangled name for a symbol based on the language for
+   that symbol.  If no demangled name exists, return NULL. */
+char *
+symbol_demangled_name (struct general_symbol_info *gsymbol)
+{
+  if (gsymbol->language == language_cplus
+      || gsymbol->language == language_java)
+    return gsymbol->language_specific.cplus_specific.demangled_name;
 
+  else if (gsymbol->language == language_objc)
+    return gsymbol->language_specific.objc_specific.demangled_name;
+
+  else 
+    return NULL;
+
+  /* OBSOLETE (SYMBOL_LANGUAGE (symbol) == language_chill */
+  /* OBSOLETE ? SYMBOL_CHILL_DEMANGLED_NAME (symbol) */
+}
 \f
 
 
index 38637475c04aa1bf8b11a297cbce87ca332c5272..941a7f12ad2c2a0427ec90a678164ef4ef75e5dd 100644 (file)
@@ -151,19 +151,11 @@ extern void symbol_init_language_specific (struct general_symbol_info *symbol,
 extern void symbol_init_demangled_name (struct general_symbol_info *symbol,
                                        struct obstack *obstack);
 
-
-/* Macro that returns the demangled name for a symbol based on the language
-   for that symbol.  If no demangled name exists, returns NULL. */
-
-#define SYMBOL_DEMANGLED_NAME(symbol)                                  \
-  (SYMBOL_LANGUAGE (symbol) == language_cplus                          \
-   || SYMBOL_LANGUAGE (symbol) == language_java                                \
-   ? SYMBOL_CPLUS_DEMANGLED_NAME (symbol)                              \
-      : (SYMBOL_LANGUAGE (symbol) == language_objc                     \
-         ? SYMBOL_OBJC_DEMANGLED_NAME (symbol)                         \
-   : /* OBSOLETE (SYMBOL_LANGUAGE (symbol) == language_chill */                \
-     /* OBSOLETE ? SYMBOL_CHILL_DEMANGLED_NAME (symbol) */             \
-        NULL))
+/* Return the demangled name for a symbol based on the language for
+   that symbol.  If no demangled name exists, return NULL. */
+#define SYMBOL_DEMANGLED_NAME(symbol) \
+  (symbol_demangled_name (&(symbol)->ginfo))
+extern char *symbol_demangled_name (struct general_symbol_info *symbol);
 
 /* OBSOLETE #define SYMBOL_CHILL_DEMANGLED_NAME(symbol) */
 /* OBSOLETE (symbol)->ginfo.language_specific.chill_specific.demangled_name */