aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2024-05-16 17:28:13 -0400
committerSimon Marchi <simon.marchi@efficios.com>2024-07-15 14:34:12 -0400
commitda877546dbf8499a29230466f8c60e2a1b0b846f (patch)
tree5b20f1d55e6e0d1f0fca44da10471ee9c61513f4
parentd1e4438fa183c92487d18b7ccfbe0c10166709d9 (diff)
downloadgdb-da877546dbf8499a29230466f8c60e2a1b0b846f.zip
gdb-da877546dbf8499a29230466f8c60e2a1b0b846f.tar.gz
gdb-da877546dbf8499a29230466f8c60e2a1b0b846f.tar.bz2
gdb: pass program space to objfile::objfile
Make the current program space reference bubble up one level. Change-Id: I81e45e89e0cfd87c308f801d49ae811a941348b7 Approved-By: Tom Tromey <tom@tromey.com> Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
-rw-r--r--gdb/objfiles.c8
-rw-r--r--gdb/objfiles.h3
2 files changed, 7 insertions, 4 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index f54813d..2d6a49c 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 9143fbf..e43669c 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: