From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 10/10] Remove symbol_get_demangled_name
Date: Wed, 25 Mar 2020 14:07:15 -0600 [thread overview]
Message-ID: <20200325200715.12947-11-tom@tromey.com> (raw)
In-Reply-To: <20200325200715.12947-1-tom@tromey.com>
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-03-25 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.
---
gdb/ChangeLog | 7 +++++++
gdb/symtab.c | 21 +++------------------
gdb/symtab.h | 3 ---
3 files changed, 10 insertions(+), 21 deletions(-)
diff --git a/gdb/symtab.c b/gdb/symtab.c
index bdbfe8e60d3..02351eb2dd0 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;
-}
-
\f
/* 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 83938d064fe..65e1973f2b0 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -513,9 +513,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
--
2.17.2
next prev parent reply other threads:[~2020-03-25 20:07 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-25 20:07 [PATCH 00/10] Fix two name-related bugs in DWARF reader Tom Tromey
2020-03-25 20:07 ` [PATCH 01/10] Convert symbol_set_demangled_name to a method Tom Tromey
2020-03-25 20:07 ` [PATCH 02/10] Move the rust "{" hack Tom Tromey
2020-03-25 20:07 ` [PATCH 03/10] Fix two latent Rust bugs Tom Tromey
2020-03-25 20:07 ` [PATCH 04/10] Add attribute::value_as_string method Tom Tromey
2020-03-25 20:07 ` [PATCH 05/10] Introduce new add_psymbol_to_list overload Tom Tromey
2020-03-25 20:07 ` [PATCH 06/10] Use the " Tom Tromey
2020-03-25 20:07 ` [PATCH 07/10] Don't call compute_and_set_names for partial symbols Tom Tromey
2020-03-25 20:07 ` [PATCH 08/10] Use the linkage name if it exists Tom Tromey
2020-04-24 16:06 ` Tom de Vries
2020-04-24 18:09 ` Tom de Vries
2020-04-24 20:50 ` Tom Tromey
2020-04-24 21:27 ` [committed][gdb/testsuite] Fix language in dw2-bad-mips-linkage-name.exp Tom de Vries
2020-04-24 21:34 ` Tom Tromey
2020-03-25 20:07 ` [PATCH 09/10] Fix Rust test cases Tom Tromey
2020-03-25 20:07 ` Tom Tromey [this message]
2020-03-25 22:48 ` [PATCH 00/10] Fix two name-related bugs in DWARF reader Christian Biesinger
2020-03-25 23:50 ` Tom Tromey
2020-04-24 14:18 ` Tom de Vries
2020-04-24 14:45 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200325200715.12947-11-tom@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox