From: Sergio Durigan Junior Date: Sat, 2 Jun 2012 04:34:23 +0000 (+0000) Subject: 2012-06-02 Sergio Durigan Junior X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c6e5ee5efa5cfda9531dd64d13dbe645ad2ab84c;p=binutils-gdb.git 2012-06-02 Sergio Durigan Junior * symtab.c (symbol_demangled_name): New variable `dem_name'. Use it to optimize resolution of demangled name. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 84ec8f096eb..024a139e966 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2012-06-02 Sergio Durigan Junior + + * symtab.c (symbol_demangled_name): New variable `dem_name'. Use + it to optimize resolution of demangled name. + 2012-06-01 Jan Kratochvil * configure.ac (development): Define new variable. diff --git a/gdb/symtab.c b/gdb/symtab.c index 85ddd1dfb39..5eb7ced1870 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