aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.h
diff options
context:
space:
mode:
authorChristian Biesinger <cbiesinger@google.com>2019-11-26 14:41:30 -0600
committerChristian Biesinger <cbiesinger@google.com>2019-11-27 11:09:18 -0600
commit43678b0afe412f6e920e1edd6d403068918ab259 (patch)
treea7306431f0369659eb437b9d0ea258e4f1c7bc79 /gdb/symtab.h
parentdb5960b4d22761507097f816b1dac3bb56a22bb5 (diff)
downloadgdb-43678b0afe412f6e920e1edd6d403068918ab259.zip
gdb-43678b0afe412f6e920e1edd6d403068918ab259.tar.gz
gdb-43678b0afe412f6e920e1edd6d403068918ab259.tar.bz2
Replace SYMBOL_SET_LINKAGE_NAME with a member function
Easier to read, shorter, and will later make it possible to make the name field private. gdb/ChangeLog: 2019-11-27 Christian Biesinger <cbiesinger@google.com> * ada-exp.y (write_ambiguous_var): Replace SYMBOL_SET_LINKAGE_NAME with sym->set_linkage_name. * coffread.c (coff_read_enum_type): Likewise. * mdebugread.c (parse_symbol): Likewise. * stabsread.c (patch_block_stabs): Likewise. (define_symbol): Likewise. (read_enum_type): Likewise. (common_block_end): Likewise. * symtab.h (struct general_symbol_info) <set_linkage_name>: New function. (SYMBOL_SET_LINKAGE_NAME): Remove. * xcoffread.c (process_xcoff_symbol): Replace SYMBOL_SET_LINKAGE_NAME with sym->set_linkage_name. Change-Id: I174a0542c014f1b035070068076308bb8ae79abb
Diffstat (limited to 'gdb/symtab.h')
-rw-r--r--gdb/symtab.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/gdb/symtab.h b/gdb/symtab.h
index a52f2a5..7a51456 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -416,6 +416,14 @@ struct general_symbol_info
returns the same value (same pointer) as linkage_name (). */
const char *search_name () const;
+ /* Set just the linkage name of a symbol; do not try to demangle
+ it. Used for constructs which do not have a mangled name,
+ e.g. struct tags. Unlike SYMBOL_SET_NAMES, linkage_name must
+ be terminated and either already on the objfile's obstack or
+ permanently allocated. */
+ void set_linkage_name (const char *linkage_name)
+ { name = linkage_name; }
+
/* Name of the symbol. This is a required field. Storage for the
name is allocated on the objfile_obstack for the associated
objfile. For languages like C++ that make a distinction between
@@ -528,7 +536,6 @@ extern void symbol_set_language (struct general_symbol_info *symbol,
enum language language,
struct obstack *obstack);
-
/* Try to determine the demangled name for a symbol, based on the
language of that symbol. If the language is set to language_auto,
it will attempt to find any demangling algorithm that works and
@@ -538,14 +545,6 @@ extern void symbol_set_language (struct general_symbol_info *symbol,
extern char *symbol_find_demangled_name (struct general_symbol_info *gsymbol,
const char *mangled);
-/* Set just the linkage name of a symbol; do not try to demangle
- it. Used for constructs which do not have a mangled name,
- e.g. struct tags. Unlike SYMBOL_SET_NAMES, linkage_name must
- be terminated and either already on the objfile's obstack or
- permanently allocated. */
-#define SYMBOL_SET_LINKAGE_NAME(symbol,linkage_name) \
- (symbol)->name = (linkage_name)
-
/* Set the linkage and natural names of a symbol, by demangling
the linkage name. If linkage_name may not be nullterminated,
copy_name must be set to true. */