forked from Imagelibrary/binutils-gdb
gdb: pass program space to objfile::make
Make the current program space reference bubble up one level. Change-Id: Iee8b11c853c76e539c991c4785737c69e6a1925c Approved-By: Tom Tromey <tom@tromey.com> Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
This commit is contained in:
committed by
Simon Marchi
parent
da877546db
commit
8991986e24
@@ -660,8 +660,8 @@ jit_object_close_impl (struct gdb_symbol_callbacks *cb,
|
|||||||
paddress (priv_data->gdbarch,
|
paddress (priv_data->gdbarch,
|
||||||
priv_data->entry.symfile_addr));
|
priv_data->entry.symfile_addr));
|
||||||
|
|
||||||
objfile *objfile = objfile::make (nullptr, objfile_name.c_str (),
|
objfile *objfile = objfile::make (nullptr, current_program_space,
|
||||||
OBJF_NOT_FILENAME);
|
objfile_name.c_str (), OBJF_NOT_FILENAME);
|
||||||
objfile->per_bfd->gdbarch = priv_data->gdbarch;
|
objfile->per_bfd->gdbarch = priv_data->gdbarch;
|
||||||
|
|
||||||
for (gdb_symtab &symtab : obj->symtabs)
|
for (gdb_symtab &symtab : obj->symtabs)
|
||||||
|
|||||||
@@ -442,8 +442,8 @@ add_separate_debug_objfile (struct objfile *objfile, struct objfile *parent)
|
|||||||
/* See objfiles.h. */
|
/* See objfiles.h. */
|
||||||
|
|
||||||
objfile *
|
objfile *
|
||||||
objfile::make (gdb_bfd_ref_ptr bfd_, const char *name_, objfile_flags flags_,
|
objfile::make (gdb_bfd_ref_ptr bfd_, program_space *pspace, const char *name_,
|
||||||
objfile *parent)
|
objfile_flags flags_, objfile *parent)
|
||||||
{
|
{
|
||||||
objfile *result
|
objfile *result
|
||||||
= new objfile (std::move (bfd_), current_program_space, name_, flags_);
|
= new objfile (std::move (bfd_), current_program_space, name_, flags_);
|
||||||
|
|||||||
@@ -437,8 +437,9 @@ public:
|
|||||||
~objfile ();
|
~objfile ();
|
||||||
|
|
||||||
/* Create an objfile. */
|
/* Create an objfile. */
|
||||||
static objfile *make (gdb_bfd_ref_ptr bfd_, const char *name_,
|
static objfile *make (gdb_bfd_ref_ptr bfd_, program_space *pspace,
|
||||||
objfile_flags flags_, objfile *parent = nullptr);
|
const char *name_, objfile_flags flags_,
|
||||||
|
objfile *parent = nullptr);
|
||||||
|
|
||||||
/* Remove this objfile from its program space's objfile list, and frees
|
/* Remove this objfile from its program space's objfile list, and frees
|
||||||
it. */
|
it. */
|
||||||
|
|||||||
@@ -1026,7 +1026,6 @@ symbol_file_add_with_addrs (const gdb_bfd_ref_ptr &abfd, const char *name,
|
|||||||
section_addr_info *addrs,
|
section_addr_info *addrs,
|
||||||
objfile_flags flags, struct objfile *parent)
|
objfile_flags flags, struct objfile *parent)
|
||||||
{
|
{
|
||||||
struct objfile *objfile;
|
|
||||||
const int from_tty = add_flags & SYMFILE_VERBOSE;
|
const int from_tty = add_flags & SYMFILE_VERBOSE;
|
||||||
const int mainline = add_flags & SYMFILE_MAINLINE;
|
const int mainline = add_flags & SYMFILE_MAINLINE;
|
||||||
const int always_confirm = add_flags & SYMFILE_ALWAYS_CONFIRM;
|
const int always_confirm = add_flags & SYMFILE_ALWAYS_CONFIRM;
|
||||||
@@ -1061,7 +1060,9 @@ symbol_file_add_with_addrs (const gdb_bfd_ref_ptr &abfd, const char *name,
|
|||||||
|
|
||||||
if (mainline)
|
if (mainline)
|
||||||
flags |= OBJF_MAINLINE;
|
flags |= OBJF_MAINLINE;
|
||||||
objfile = objfile::make (abfd, name, flags, parent);
|
|
||||||
|
objfile *objfile
|
||||||
|
= objfile::make (abfd, current_program_space, name, flags, parent);
|
||||||
|
|
||||||
/* We either created a new mapped symbol table, mapped an existing
|
/* We either created a new mapped symbol table, mapped an existing
|
||||||
symbol table file which has not had initial symbol reading
|
symbol table file which has not had initial symbol reading
|
||||||
|
|||||||
Reference in New Issue
Block a user