diff options
author | Tom Tromey <tom@tromey.com> | 2020-04-24 15:35:01 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2020-04-24 15:35:04 -0600 |
commit | 7151c1af38e250fa4d024fa53f1cd5b3fc199314 (patch) | |
tree | 6aadcdd62889c14c77f421d9dd7f7b1a4930402b | |
parent | 906bb4c58faa8e2c1c62e295f8054e75e910e5e8 (diff) | |
download | gdb-7151c1af38e250fa4d024fa53f1cd5b3fc199314.zip gdb-7151c1af38e250fa4d024fa53f1cd5b3fc199314.tar.gz gdb-7151c1af38e250fa4d024fa53f1cd5b3fc199314.tar.bz2 |
Remove symbol_get_demangled_name
Now that symbol_get_demangled_name is only used by general_symbol_info
methods, and because these methods already check the symbol's language
to decide what to return, symbol_get_demangled_name is no longer
needed. This patch removes it.
gdb/ChangeLog
2020-04-24 Tom Tromey <tom@tromey.com>
* symtab.h (symbol_get_demangled_name): Don't declare.
* symtab.c (symbol_get_demangled_name): Remove.
(general_symbol_info::natural_name)
(general_symbol_info::demangled_name): Update.
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/symtab.c | 21 | ||||
-rw-r--r-- | gdb/symtab.h | 3 |
3 files changed, 10 insertions, 21 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e1c64ab..ccc0baa 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,12 @@ 2020-04-24 Tom Tromey <tom@tromey.com> + * symtab.h (symbol_get_demangled_name): Don't declare. + * symtab.c (symbol_get_demangled_name): Remove. + (general_symbol_info::natural_name) + (general_symbol_info::demangled_name): Update. + +2020-04-24 Tom Tromey <tom@tromey.com> + PR rust/25025: * dwarf2/read.c (dwarf2_physname): Do not demangle for Rust. diff --git a/gdb/symtab.c b/gdb/symtab.c index 7dd41fb..652384c 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -690,21 +690,6 @@ general_symbol_info::set_demangled_name (const char *name, language_specific.demangled_name = name; } -/* Return the demangled name of GSYMBOL. */ - -const char * -symbol_get_demangled_name (const struct general_symbol_info *gsymbol) -{ - if (gsymbol->language () == language_ada) - { - if (!gsymbol->ada_mangled) - return NULL; - /* Fall through. */ - } - - return gsymbol->language_specific.demangled_name; -} - /* Initialize the language dependent portion of a symbol depending upon the language for the symbol. */ @@ -976,8 +961,8 @@ general_symbol_info::natural_name () const case language_objc: case language_fortran: case language_rust: - if (symbol_get_demangled_name (this) != NULL) - return symbol_get_demangled_name (this); + if (language_specific.demangled_name != nullptr) + return language_specific.demangled_name; break; case language_ada: return ada_decode_symbol (this); @@ -1002,7 +987,7 @@ general_symbol_info::demangled_name () const case language_objc: case language_fortran: case language_rust: - dem_name = symbol_get_demangled_name (this); + dem_name = language_specific.demangled_name; break; case language_ada: dem_name = ada_decode_symbol (this); diff --git a/gdb/symtab.h b/gdb/symtab.h index ee570f9..5c5db0f 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -542,9 +542,6 @@ struct general_symbol_info short section; }; -extern const char *symbol_get_demangled_name - (const struct general_symbol_info *); - extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, struct obj_section *); /* Return the address of SYM. The MAYBE_COPIED flag must be set on |