aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>2002-10-23 20:09:28 +0000
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>2002-10-23 20:09:28 +0000
commit9cc0d196fc91bea770f668eed89fe80f167e21c6 (patch)
treed89b45278626254355f34b2163d6fdb58188fcd1 /gdb/symtab.c
parent19de93d0c62cd26498869d1eecd6299dcf476365 (diff)
downloadgdb-9cc0d196fc91bea770f668eed89fe80f167e21c6.zip
gdb-9cc0d196fc91bea770f668eed89fe80f167e21c6.tar.gz
gdb-9cc0d196fc91bea770f668eed89fe80f167e21c6.tar.bz2
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.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 7b70aa7..3ae4f2a 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -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) */
+}