From: Simon Marchi Date: Thu, 16 May 2024 21:28:13 +0000 (-0400) Subject: gdb: pass program space to objfile::objfile X-Git-Tag: binutils-2_43~111 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=da877546dbf8499a29230466f8c60e2a1b0b846f;p=thirdparty%2Fbinutils-gdb.git gdb: pass program space to objfile::objfile Make the current program space reference bubble up one level. Change-Id: I81e45e89e0cfd87c308f801d49ae811a941348b7 Approved-By: Tom Tromey Reviewed-By: Thiago Jung Bauermann --- diff --git a/gdb/objfiles.c b/gdb/objfiles.c index f54813d9f8f..2d6a49ce543 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -306,9 +306,10 @@ build_objfile_section_table (struct objfile *objfile) requests for specific operations. Other bits like OBJF_SHARED are simply copied through to the new objfile flags member. */ -objfile::objfile (gdb_bfd_ref_ptr bfd_, const char *name, objfile_flags flags_) +objfile::objfile (gdb_bfd_ref_ptr bfd_, program_space *pspace, + const char *name, objfile_flags flags_) : flags (flags_), - m_pspace (current_program_space), + m_pspace (pspace), obfd (std::move (bfd_)) { const char *expanded_name; @@ -444,7 +445,8 @@ objfile * objfile::make (gdb_bfd_ref_ptr bfd_, const char *name_, objfile_flags flags_, objfile *parent) { - objfile *result = new objfile (std::move (bfd_), name_, flags_); + objfile *result + = new objfile (std::move (bfd_), current_program_space, name_, flags_); if (parent != nullptr) add_separate_debug_objfile (result, parent); diff --git a/gdb/objfiles.h b/gdb/objfiles.h index 9143fbf4a91..e43669c9959 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -423,7 +423,8 @@ struct objfile private: /* The only way to create an objfile is to call objfile::make. */ - objfile (gdb_bfd_ref_ptr, const char *, objfile_flags); + objfile (gdb_bfd_ref_ptr, program_space *pspace, const char *, + objfile_flags); public: