#include "debuginfod-support.h"
#include "dwarf2/public.h"
-/* Forward declarations. */
-extern const struct sym_fns elf_sym_fns_lazy_psyms;
-
/* The struct elfinfo is available only during ELF symbol table and
psymtab reading. It is destroyed at the completion of psymtab-reading.
It's local to elf_symfile_read. */
if (target_read_memory (pointer_address, buf, ptr_size) != 0)
continue;
addr = extract_typed_address (buf, ptr_type);
- addr = gdbarch_convert_from_func_ptr_addr (gdbarch, addr,
- current_top_target ());
+ addr = gdbarch_convert_from_func_ptr_addr
+ (gdbarch, addr, current_inferior ()->top_target ());
addr = gdbarch_addr_bits_remove (gdbarch, addr);
if (elf_gnu_ifunc_record_cache (name, addr))
parameter. FUNCTION is the function entry address. ADDRESS may be a
function descriptor. */
- target_auxv_search (current_top_target (), AT_HWCAP, &hwcap);
+ target_auxv_search (current_inferior ()->top_target (), AT_HWCAP, &hwcap);
hwcap_val = value_from_longest (builtin_type (gdbarch)
->builtin_unsigned_long, hwcap);
address_val = call_function_by_hand (function, NULL, hwcap_val);
address = value_as_address (address_val);
- address = gdbarch_convert_from_func_ptr_addr (gdbarch, address, current_top_target ());
+ address = gdbarch_convert_from_func_ptr_addr
+ (gdbarch, address, current_inferior ()->top_target ());
address = gdbarch_addr_bits_remove (gdbarch, address);
if (name_at_pc)
gdbarch_return_value (gdbarch, func_func, value_type, regcache,
value_contents_raw (value), NULL);
resolved_address = value_as_address (value);
- resolved_pc = gdbarch_convert_from_func_ptr_addr (gdbarch,
- resolved_address,
- current_top_target ());
+ resolved_pc = gdbarch_convert_from_func_ptr_addr
+ (gdbarch, resolved_address, current_inferior ()->top_target ());
resolved_pc = gdbarch_addr_bits_remove (gdbarch, resolved_pc);
gdb_assert (current_program_space == b->pspace || b->pspace == NULL);
}
if (dwarf2_has_info (objfile, NULL, true))
- {
- dw_index_kind index_kind;
-
- /* elf_sym_fns_gdb_index cannot handle simultaneous non-DWARF
- debug information present in OBJFILE. If there is such debug
- info present never use an index. */
- if (!objfile->has_partial_symbols ()
- && dwarf2_initialize_objfile (objfile, &index_kind))
- {
- switch (index_kind)
- {
- case dw_index_kind::GDB_INDEX:
- objfile->qf = &dwarf2_gdb_index_functions;
- break;
- case dw_index_kind::DEBUG_NAMES:
- objfile->qf = &dwarf2_debug_names_functions;
- break;
- }
- }
- else
- {
- /* It is ok to do this even if the stabs reader made some
- partial symbols, because OBJF_PSYMTABS_READ has not been
- set, and so our lazy reader function will still be called
- when needed. */
- objfile_set_sym_fns (objfile, &elf_sym_fns_lazy_psyms);
- }
- }
+ dwarf2_initialize_objfile (objfile);
/* If the file has its own symbol tables it has no separate debug
info. `.dynsym'/`.symtab' go to MSYMBOLS, `.debug_info' goes to
SYMTABS/PSYMTABS. `.gnu_debuglink' may no longer be present with
}
}
-/* Callback to lazily read psymtabs. */
-
-static void
-read_psyms (struct objfile *objfile)
-{
- if (dwarf2_has_info (objfile, NULL))
- dwarf2_build_psymtabs (objfile);
-}
-
/* Initialize anything that needs initializing when a completely new symbol
file is specified (not just adding some symbols from another file, e.g. a
shared library). */
elf_new_init, /* init anything gbl to entire symtab */
elf_symfile_init, /* read initial info, setup for sym_read() */
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 */
-};
-
-/* The same as elf_sym_fns, but not registered and lazily reads
- psymbols. */
-
-const struct sym_fns elf_sym_fns_lazy_psyms =
-{
- elf_new_init, /* init anything gbl to entire symtab */
- elf_symfile_init, /* read initial info, setup for sym_read() */
- elf_symfile_read, /* read a symbol file into symtab */
- read_psyms, /* 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. */