aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
authorSergio Durigan Junior <sergiodj@redhat.com>2012-06-02 04:34:23 +0000
committerSergio Durigan Junior <sergiodj@redhat.com>2012-06-02 04:34:23 +0000
commitc6e5ee5efa5cfda9531dd64d13dbe645ad2ab84c (patch)
tree1a6fa7c90babcd6752876d973ed45f576f9dcadc /gdb/symtab.c
parent124d95f6ca990168dfe50490d45fb7bfdd541722 (diff)
downloadgdb-c6e5ee5efa5cfda9531dd64d13dbe645ad2ab84c.zip
gdb-c6e5ee5efa5cfda9531dd64d13dbe645ad2ab84c.tar.gz
gdb-c6e5ee5efa5cfda9531dd64d13dbe645ad2ab84c.tar.bz2
2012-06-02 Sergio Durigan Junior <sergiodj@redhat.com>
* symtab.c (symbol_demangled_name): New variable `dem_name'. Use it to optimize resolution of demangled name.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 85ddd1d..5eb7ced 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -850,6 +850,8 @@ symbol_natural_name (const struct general_symbol_info *gsymbol)
const char *
symbol_demangled_name (const struct general_symbol_info *gsymbol)
{
+ const char *dem_name = NULL;
+
switch (gsymbol->language)
{
case language_cplus:
@@ -858,19 +860,17 @@ symbol_demangled_name (const struct general_symbol_info *gsymbol)
case language_java:
case language_objc:
case language_fortran:
- if (symbol_get_demangled_name (gsymbol) != NULL)
- return symbol_get_demangled_name (gsymbol);
+ dem_name = symbol_get_demangled_name (gsymbol);
break;
case language_ada:
- if (symbol_get_demangled_name (gsymbol) != NULL)
- return symbol_get_demangled_name (gsymbol);
- else
- return ada_decode_symbol (gsymbol);
+ dem_name = symbol_get_demangled_name (gsymbol);
+ if (dem_name == NULL)
+ dem_name = ada_decode_symbol (gsymbol);
break;
default:
break;
}
- return NULL;
+ return dem_name;
}
/* Return the search name of a symbol---generally the demangled or