/* Reading symbol files from memory.
- Copyright (C) 1986-2020 Free Software Foundation, Inc.
+ Copyright (C) 1986-2021 Free Software Foundation, Inc.
This file is part of GDB.
#include "auxv.h"
#include "elf/common.h"
#include "gdb_bfd.h"
+#include "inferior.h"
/* Verify parameters of target_read_memory_bfd and target_read_memory are
compatible. */
objf = symbol_file_add_from_bfd (nbfd, bfd_get_filename (nbfd),
add_flags, &sai, OBJF_SHARED, NULL);
- add_target_sections_of_objfile (objf);
+ current_program_space->add_target_sections (objf);
/* This might change our ideas about frames already looked at. */
reinit_frame_cache ();
addr = parse_and_eval_address (args);
/* We need some representative bfd to know the target we are looking at. */
- if (symfile_objfile != NULL)
- templ = symfile_objfile->obfd;
+ if (current_program_space->symfile_object_file != NULL)
+ templ = current_program_space->symfile_object_file->obfd;
else
- templ = exec_bfd;
+ templ = current_program_space->exec_bfd ();
if (templ == NULL)
error (_("Must use symbol-file or exec-file "
"before add-symbol-file-from-memory."));
{
struct mem_range vsyscall_range;
- if (gdbarch_vsyscall_range (target_gdbarch (), &vsyscall_range))
+ if (gdbarch_vsyscall_range (inf->gdbarch, &vsyscall_range))
{
struct bfd *bfd;
if (core_bfd != NULL)
bfd = core_bfd;
- else if (exec_bfd != NULL)
- bfd = exec_bfd;
+ else if (current_program_space->exec_bfd () != NULL)
+ bfd = current_program_space->exec_bfd ();
else
/* FIXME: cagney/2004-05-06: Should not require an existing
BFD when trying to create a run-time BFD of the VSYSCALL
_initialize_symfile_mem ()
{
add_cmd ("add-symbol-file-from-memory", class_files,
- add_symbol_file_from_memory_command,
+ add_symbol_file_from_memory_command,
_("Load the symbols out of memory from a "
"dynamically loaded object file.\n"
"Give an expression for the address "
"of the file's shared object file header."),
- &cmdlist);
+ &cmdlist);
/* Want to know of each new inferior so that its vsyscall info can
be extracted. */
- gdb::observers::inferior_created.attach (add_vsyscall_page);
+ gdb::observers::inferior_created.attach (add_vsyscall_page, "symfile-mem");
}