int pt_phdr_p = 0;
/* Get required auxv elements from target. */
- if (target_auxv_search (current_top_target (), AT_PHDR, &at_phdr) <= 0)
+ if (target_auxv_search (current_inferior ()->top_target (),
+ AT_PHDR, &at_phdr) <= 0)
return {};
- if (target_auxv_search (current_top_target (), AT_PHENT, &at_phent) <= 0)
+ if (target_auxv_search (current_inferior ()->top_target (),
+ AT_PHENT, &at_phent) <= 0)
return {};
- if (target_auxv_search (current_top_target (), AT_PHNUM, &at_phnum) <= 0)
+ if (target_auxv_search (current_inferior ()->top_target (),
+ AT_PHNUM, &at_phnum) <= 0)
return {};
if (!at_phdr || !at_phnum)
return {};
return 0;
bool found = false;
- for (target_section &target_section : current_program_space->target_sections)
+ for (const target_section &target_section
+ : current_program_space->target_sections ())
if (sect == target_section.the_bfd_section)
{
dyn_addr = target_section.addr;
/* Fetch the list of shared libraries. */
gdb::optional<gdb::char_vector> svr4_library_document
- = target_read_stralloc (current_top_target (), TARGET_OBJECT_LIBRARIES_SVR4,
+ = target_read_stralloc (current_inferior ()->top_target (),
+ TARGET_OBJECT_LIBRARIES_SVR4,
annex);
if (!svr4_library_document)
return 0;
sym_addr = gdbarch_addr_bits_remove
(target_gdbarch (),
- gdbarch_convert_from_func_ptr_addr (target_gdbarch (),
- sym_addr,
- current_top_target ()));
+ gdbarch_convert_from_func_ptr_addr
+ (target_gdbarch (), sym_addr, current_inferior ()->top_target ()));
/* On at least some versions of Solaris there's a dynamic relocation
on _r_debug.r_brk and SYM_ADDR may not be relocated yet, e.g., if
goto bkpt_at_symbol;
/* Now convert the TMP_BFD into a target. That way target, as
- well as BFD operations can be used. target_bfd_reopen
- acquires its own reference. */
- tmp_bfd_target = target_bfd_reopen (tmp_bfd.get ());
+ well as BFD operations can be used. */
+ tmp_bfd_target = target_bfd_reopen (tmp_bfd);
/* On a running target, we can get the dynamic linker's base
address from the shared library table. */
/* If we were not able to find the base address of the loader
from our so_list, then try using the AT_BASE auxilliary entry. */
if (!load_addr_found)
- if (target_auxv_search (current_top_target (), AT_BASE, &load_addr) > 0)
+ if (target_auxv_search (current_inferior ()->top_target (),
+ AT_BASE, &load_addr) > 0)
{
int addr_bit = gdbarch_addr_bit (target_gdbarch ());
&& (BMSYMBOL_VALUE_ADDRESS (msymbol) != 0))
{
sym_addr = BMSYMBOL_VALUE_ADDRESS (msymbol);
- sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (),
- sym_addr,
- current_top_target ());
+ sym_addr = gdbarch_convert_from_func_ptr_addr
+ (target_gdbarch (), sym_addr, current_inferior ()->top_target ());
svr4_create_solib_event_breakpoints (info, target_gdbarch (),
sym_addr);
return 1;
&& (BMSYMBOL_VALUE_ADDRESS (msymbol) != 0))
{
sym_addr = BMSYMBOL_VALUE_ADDRESS (msymbol);
- sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (),
- sym_addr,
- current_top_target ());
+ sym_addr = gdbarch_convert_from_func_ptr_addr
+ (target_gdbarch (), sym_addr,
+ current_inferior ()->top_target ());
svr4_create_solib_event_breakpoints (info, target_gdbarch (),
sym_addr);
return 1;
if ((bfd_get_file_flags (current_program_space->exec_bfd ()) & DYNAMIC) == 0)
return 0;
- if (target_auxv_search (current_top_target (), AT_ENTRY, &entry_point) <= 0)
+ if (target_auxv_search (current_inferior ()->top_target (),
+ AT_ENTRY, &entry_point) <= 0)
return 0;
exec_displacement
svr4_so_ops.update_breakpoints = svr4_update_solib_event_breakpoints;
svr4_so_ops.handle_event = svr4_handle_solib_event;
- gdb::observers::free_objfile.attach (svr4_free_objfile_observer);
+ gdb::observers::free_objfile.attach (svr4_free_objfile_observer,
+ "solib-svr4");
}