diff options
author | Tom Tromey <tom@tromey.com> | 2019-03-02 13:07:47 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-03-15 16:02:10 -0600 |
commit | eefba3da27c23db67cc0e1707fcedd96f1c0860d (patch) | |
tree | 61c03e529eccc8f7d1452871f62042c696441905 /gdb/solib.c | |
parent | 0de2420c4b023e644f91a409803fedfb235bfc0b (diff) | |
download | gdb-eefba3da27c23db67cc0e1707fcedd96f1c0860d.zip gdb-eefba3da27c23db67cc0e1707fcedd96f1c0860d.tar.gz gdb-eefba3da27c23db67cc0e1707fcedd96f1c0860d.tar.bz2 |
Change minimal_symbol inheritance
This changes struct minimal_symbol to inherit from general_symbol_info
and updates various macros to cope.
Because MSYMBOL_SET_LANGUAGE and MSYMBOL_SET_NAMES were only used from
a single spot, this patch removes them in favor of simply inlining
their definitions. I consider this to be somewhat cleaner, not least
because the "phony polymorphism" provided by such macros is not useful
in practice.
gdb/ChangeLog
2019-03-15 Tom Tromey <tom@tromey.com>
* symtab.h (struct minimal_symbol): Derive from
general_symbol_info.
(MSYMBOL_VALUE, MSYMBOL_VALUE_RAW_ADDRESS)
(MSYMBOL_VALUE_ADDRESS, MSYMBOL_VALUE_BYTES)
(MSYMBOL_BLOCK_VALUE, MSYMBOL_VALUE_CHAIN, MSYMBOL_LANGUAGE)
(MSYMBOL_SECTION, MSYMBOL_OBJ_SECTION, MSYMBOL_NATURAL_NAME)
(MSYMBOL_LINKAGE_NAME, MSYMBOL_DEMANGLED_NAME)
(MSYMBOL_SEARCH_NAME): Update.
(MSYMBOL_SET_LANGUAGE, MSYMBOL_SET_NAMES): Remove.
* solib.c (gdb_bfd_lookup_symbol_from_symtab): Don't use memset.
* minsyms.c (minimal_symbol_reader::record_full): Update.
Diffstat (limited to 'gdb/solib.c')
-rw-r--r-- | gdb/solib.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gdb/solib.c b/gdb/solib.c index 791b94b..017cd62 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -1501,9 +1501,8 @@ gdb_bfd_lookup_symbol_from_symtab (bfd *abfd, if (bfd_get_flavour (abfd) == bfd_target_elf_flavour && gdbarch_elf_make_msymbol_special_p (gdbarch)) { - struct minimal_symbol msym; + struct minimal_symbol msym {}; - memset (&msym, 0, sizeof (msym)); SET_MSYMBOL_VALUE_ADDRESS (&msym, symaddr); gdbarch_elf_make_msymbol_special (gdbarch, sym, &msym); symaddr = MSYMBOL_VALUE_RAW_ADDRESS (&msym); |