diff options
author | Christian Biesinger <cbiesinger@google.com> | 2019-11-04 13:12:09 -0600 |
---|---|---|
committer | Christian Biesinger <cbiesinger@google.com> | 2019-11-12 15:21:35 -0600 |
commit | 468c0cbb327fadf28386a989f929fcbed4aed8b9 (patch) | |
tree | df5e63c82ad35603b4fbc8716e72dd417176601e /gdb/ada-exp.y | |
parent | ed2c82c364043cf4726541cc7e8011197185b3f8 (diff) | |
download | binutils-gdb-468c0cbb327fadf28386a989f929fcbed4aed8b9.tar.gz |
Make struct symbol inherit from general_symbol_info
Since this is now no longer a POD, also give it a constructor that
initializes all fields. (I have considered overloading operator new
to zero-initialize the memory instead; let me know if you prefer that)
gdb/ChangeLog:
2019-11-12 Christian Biesinger <cbiesinger@google.com>
* ada-exp.y (write_ambiguous_var): Update.
* buildsym.c (add_symbol_to_list): Update.
* dwarf2read.c (read_variable): Update.
(new_symbol): Update.
* jit.c (finalize_symtab): Update.
* language.c (language_alloc_type_symbol): Update.
* symtab.c (fixup_symbol_section): Update.
(initialize_objfile_symbol_1): Move code to...
(initialize_objfile_symbol): ...here. Remove now-unnecessary memset.
(allocate_symbol): Update.
(allocate_template_symbol): Update.
(get_symbol_address): Update.
* symtab.h (struct symbol): Inherit from general_symbol_info instead
of having as a field, and add a constructor.
(SYMBOL_VALUE): Update.
(SYMBOL_VALUE_ADDRESS): Update.
(SET_SYMBOL_VALUE_ADDRESS): Update.
(SYMBOL_VALUE_BYTES): Update.
(SYMBOL_VALUE_COMMON_BLOCK): Update.
(SYMBOL_BLOCK_VALUE): Update.
(SYMBOL_VALUE_CHAIN): Update.
(SYMBOL_LANGUAGE): Update.
(SYMBOL_SECTION): Update.
(SYMBOL_OBJ_SECTION): Update.
(SYMBOL_SET_LANGUAGE): Update.
(SYMBOL_SET_LINKAGE_NAME): Update.
(SYMBOL_SET_NAMES): Update.
(SYMBOL_NATURAL_NAME): Update.
(SYMBOL_LINKAGE_NAME): Update.
(SYMBOL_DEMANGLED_NAME): Update.
(SYMBOL_SEARCH_NAME): Update.
(SYMBOL_MATCHES_SEARCH_NAME): Update.
(struct symbol): Update.
(struct template_symbol): Update.
(struct rust_vtable_symbol): Update.
* xcoffread.c (SYMBOL_DUP): Update.
Change-Id: I05b1628455bcce3efaa101e65ef051708d17eb07
Diffstat (limited to 'gdb/ada-exp.y')
-rw-r--r-- | gdb/ada-exp.y | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y index 160e64bc05b..ff3ce763924 100644 --- a/gdb/ada-exp.y +++ b/gdb/ada-exp.y @@ -1102,9 +1102,8 @@ static void write_ambiguous_var (struct parser_state *par_state, const struct block *block, char *name, int len) { - struct symbol *sym = XOBNEW (&temp_parse_space, struct symbol); + struct symbol *sym = new (&temp_parse_space) symbol (); - memset (sym, 0, sizeof (struct symbol)); SYMBOL_DOMAIN (sym) = UNDEF_DOMAIN; SYMBOL_LINKAGE_NAME (sym) = obstack_strndup (&temp_parse_space, name, len); SYMBOL_LANGUAGE (sym) = language_ada; |