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/dwarf2read.c | |
parent | ed2c82c364043cf4726541cc7e8011197185b3f8 (diff) | |
download | gdb-468c0cbb327fadf28386a989f929fcbed4aed8b9.zip gdb-468c0cbb327fadf28386a989f929fcbed4aed8b9.tar.gz gdb-468c0cbb327fadf28386a989f929fcbed4aed8b9.tar.bz2 |
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/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 0a7a033..bbfa442 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -14320,8 +14320,7 @@ read_variable (struct die_info *die, struct dwarf2_cu *cu) { struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile; - storage = OBSTACK_ZALLOC (&objfile->objfile_obstack, - struct rust_vtable_symbol); + storage = new (&objfile->objfile_obstack) rust_vtable_symbol (); initialize_objfile_symbol (storage); storage->concrete_type = containing_type; storage->subclass = SYMBOL_RUST_VTABLE; @@ -21636,8 +21635,8 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, /* Fortran does not have mangling standard and the mangling does differ between gfortran, iFort etc. */ if (cu->language == language_fortran - && symbol_get_demangled_name (&(sym->ginfo)) == NULL) - symbol_set_demangled_name (&(sym->ginfo), + && symbol_get_demangled_name (sym) == NULL) + symbol_set_demangled_name (sym, dwarf2_full_name (name, die, cu), NULL); |