aboutsummaryrefslogtreecommitdiff
path: root/gdb/elfread.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-03-20 17:23:40 -0600
committerTom Tromey <tom@tromey.com>2021-03-20 17:23:41 -0600
commit5c3f1e5bfc0cf45d8bc734aabaf0225b72a31096 (patch)
treee80ff71d12c21e772aa63f6d5d5318215a932eb6 /gdb/elfread.c
parent9b99dcc8dbc4367b2d2af78ee896508b67f5517a (diff)
downloadgdb-5c3f1e5bfc0cf45d8bc734aabaf0225b72a31096.zip
gdb-5c3f1e5bfc0cf45d8bc734aabaf0225b72a31096.tar.gz
gdb-5c3f1e5bfc0cf45d8bc734aabaf0225b72a31096.tar.bz2
Move sym_fns::qf to objfile
Currently the "partial" symbol reader is attached to the objfile's symbol functions. However, in order to allow multiple separate partial symbol readers, this association must be changed. This patch moves the "qf" member out of sym_fns as a step toward that goal. gdb/ChangeLog 2021-03-20 Tom Tromey <tom@tromey.com> * psymtab.c (require_partial_symbols): Check that 'sf' is not null. * xcoffread.c (xcoff_sym_fns): Update. * symfile.h (struct sym_fns) <qf>: Remove. * symfile.c (syms_from_objfile_1, reread_symbols): Update. * symfile-debug.c (objfile::has_partial_symbols) (objfile::find_last_source_symtab) (objfile::forget_cached_source_info) (objfile::map_symtabs_matching_filename, objfile::lookup_symbol) (objfile::print_stats, objfile::dump) (objfile::expand_symtabs_for_function) (objfile::expand_all_symtabs) (objfile::expand_symtabs_with_fullname) (objfile::map_matching_symbols) (objfile::expand_symtabs_matching) (objfile::find_pc_sect_compunit_symtab) (objfile::map_symbol_filenames) (objfile::find_compunit_symtab_by_address) (objfile::lookup_global_symbol_language, debug_sym_fns) (install_symfile_debug_logging): Update. * objfiles.h (struct objfile) <qf>: New member. * mipsread.c (ecoff_sym_fns): Update. * machoread.c (macho_sym_fns): Update. * elfread.c (elf_sym_fns_gdb_index, elf_sym_fns_debug_names): Don't declare. (elf_symfile_read, elf_sym_fns, elf_sym_fns_lazy_psyms): Update. * dbxread.c (aout_sym_fns): Update. * coffread.c (coff_sym_fns): Update.
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r--gdb/elfread.c42
1 files changed, 2 insertions, 40 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 439f5cc..3ba7221 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -54,8 +54,6 @@
#include "dwarf2/public.h"
/* Forward declarations. */
-extern const struct sym_fns elf_sym_fns_gdb_index;
-extern const struct sym_fns elf_sym_fns_debug_names;
extern const struct sym_fns elf_sym_fns_lazy_psyms;
/* The struct elfinfo is available only during ELF symbol table and
@@ -1272,10 +1270,10 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
switch (index_kind)
{
case dw_index_kind::GDB_INDEX:
- objfile_set_sym_fns (objfile, &elf_sym_fns_gdb_index);
+ objfile->qf = &dwarf2_gdb_index_functions;
break;
case dw_index_kind::DEBUG_NAMES:
- objfile_set_sym_fns (objfile, &elf_sym_fns_debug_names);
+ objfile->qf = &dwarf2_debug_names_functions;
break;
}
}
@@ -1437,7 +1435,6 @@ static const struct sym_fns elf_sym_fns =
NULL,
default_symfile_relocate, /* Relocate a debug section. */
&elf_probe_fns, /* sym_probe_fns */
- &psym_functions
};
/* The same as elf_sym_fns, but not registered and lazily reads
@@ -1455,41 +1452,6 @@ const struct sym_fns elf_sym_fns_lazy_psyms =
NULL,
default_symfile_relocate, /* Relocate a debug section. */
&elf_probe_fns, /* sym_probe_fns */
- &psym_functions
-};
-
-/* The same as elf_sym_fns, but not registered and uses the
- DWARF-specific GNU index rather than psymtab. */
-const struct sym_fns elf_sym_fns_gdb_index =
-{
- elf_new_init, /* init anything gbl to entire symab */
- elf_symfile_init, /* read initial info, setup for sym_red() */
- elf_symfile_read, /* read a symbol file into symtab */
- NULL, /* sym_read_psymbols */
- elf_symfile_finish, /* finished with file, cleanup */
- default_symfile_offsets, /* Translate ext. to int. relocation */
- elf_symfile_segments, /* Get segment information from a file. */
- NULL,
- default_symfile_relocate, /* Relocate a debug section. */
- &elf_probe_fns, /* sym_probe_fns */
- &dwarf2_gdb_index_functions
-};
-
-/* The same as elf_sym_fns, but not registered and uses the
- DWARF-specific .debug_names index rather than psymtab. */
-const struct sym_fns elf_sym_fns_debug_names =
-{
- elf_new_init, /* init anything gbl to entire symab */
- elf_symfile_init, /* read initial info, setup for sym_red() */
- elf_symfile_read, /* read a symbol file into symtab */
- NULL, /* sym_read_psymbols */
- elf_symfile_finish, /* finished with file, cleanup */
- default_symfile_offsets, /* Translate ext. to int. relocation */
- elf_symfile_segments, /* Get segment information from a file. */
- NULL,
- default_symfile_relocate, /* Relocate a debug section. */
- &elf_probe_fns, /* sym_probe_fns */
- &dwarf2_debug_names_functions
};
/* STT_GNU_IFUNC resolver vector to be installed to gnu_ifunc_fns_p. */