diff options
author | Tom Tromey <tom@tromey.com> | 2021-03-20 17:23:40 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-03-20 17:23:42 -0600 |
commit | 39298a5d973d5822ed7d09230f67cc83f72a06c2 (patch) | |
tree | 468409018aab2f1b1856aec397eee5bd38d19f51 /gdb/elfread.c | |
parent | 5c3f1e5bfc0cf45d8bc734aabaf0225b72a31096 (diff) | |
download | gdb-39298a5d973d5822ed7d09230f67cc83f72a06c2.zip gdb-39298a5d973d5822ed7d09230f67cc83f72a06c2.tar.gz gdb-39298a5d973d5822ed7d09230f67cc83f72a06c2.tar.bz2 |
Convert quick_symbol_functions to use methods
This changes quick_symbol_functions to be a base class with pure
virtual methods, rather than a struct holding function pointers.
Then, objfile is changed to hold a unique_ptr to an instance of this
class.
struct psymbol_functions is put into psympriv.h, and not psymtab.c,
because that is convenient later in the series.
gdb/ChangeLog
2021-03-20 Tom Tromey <tom@tromey.com>
* psympriv.h (struct psymbol_functions): New.
* symfile.c (syms_from_objfile_1, reread_symbols): Update.
* symfile-debug.c (objfile::find_compunit_symtab_by_address)
(objfile::lookup_global_symbol_language): Update.
* quick-symbol.h (struct quick_symbol_functions): Convert function
pointers to methods. Add virtual destructor.
(quick_symbol_functions_up): New typedef.
* psymtab.h (psym_functions, dwarf2_gdb_index_functions)
(dwarf2_debug_names_functions): Don't declare.
(make_psymbol_functions): Declare.
* psymtab.c (psymbol_functions::map_symtabs_matching_filename)
(psymbol_functions::find_pc_sect_compunit_symtab)
(psymbol_functions::lookup_symbol)
(psymbol_functions::lookup_global_symbol_language)
(psymbol_functions::find_last_source_symtab)
(psymbol_functions::forget_cached_source_info)
(psymbol_functions::print_stats, psymbol_functions::dump)
(psymbol_functions::expand_symtabs_for_function)
(psymbol_functions::expand_all_symtabs)
(psymbol_functions::expand_symtabs_with_fullname)
(psymbol_functions::map_symbol_filenames)
(psymbol_functions::map_matching_symbols)
(psymbol_functions::expand_symtabs_matching)
(psymbol_functions::has_symbols)
(psymbol_functions::find_compunit_symtab_by_address): Rename.
(psym_functions): Remove.
(make_psymbol_functions): New function.
* objfiles.h (struct objfile) <qf>: Change type.
* elfread.c (elf_symfile_read): Update.
* dwarf2/read.c (struct dwarf2_base_index_functions)
(struct dwarf2_gdb_index, struct dwarf2_debug_names_index): New.
(make_dwarf_gdb_index, make_dwarf_debug_names): New functions.
(dwarf2_base_index_functions::find_last_source_symtab)
(dwarf2_base_index_functions::forget_cached_source_info)
(dwarf2_base_index_functions::map_symtabs_matching_filename)
(dwarf2_gdb_index::lookup_symbol)
(dwarf2_base_index_functions::print_stats)
(dwarf2_gdb_index::dump)
(dwarf2_gdb_index::expand_symtabs_for_function)
(dwarf2_base_index_functions::expand_all_symtabs)
(dwarf2_base_index_functions::expand_symtabs_with_fullname):
Rename.
(dwarf2_gdb_index::map_matching_symbols): New method.
(dwarf2_gdb_index::expand_symtabs_matching): New method.
(dwarf2_base_index_functions::find_pc_sect_compunit_symtab)
(dwarf2_base_index_functions::map_symbol_filenames)
(dwarf2_base_index_functions::has_symbols): Rename.
(dwarf2_gdb_index_functions): Remove.
(dwarf2_debug_names_index::lookup_symbol)
(dwarf2_debug_names_index::dump)
(dwarf2_debug_names_index::expand_symtabs_for_function)
(dwarf2_debug_names_index::map_matching_symbols)
(dwarf2_debug_names_index::expand_symtabs_matching): Rename.
(dwarf2_debug_names_functions): Remove.
* dwarf2/public.h (make_dwarf_gdb_index, make_dwarf_debug_names):
Declare.
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r-- | gdb/elfread.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c index 3ba7221..4ca1f4d 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -1270,10 +1270,10 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) switch (index_kind) { case dw_index_kind::GDB_INDEX: - objfile->qf = &dwarf2_gdb_index_functions; + objfile->qf = make_dwarf_gdb_index (); break; case dw_index_kind::DEBUG_NAMES: - objfile->qf = &dwarf2_debug_names_functions; + objfile->qf = make_dwarf_debug_names (); break; } } |