]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: pass program space to objfile::make
authorSimon Marchi <simon.marchi@polymtl.ca>
Thu, 16 May 2024 21:30:22 +0000 (17:30 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 15 Jul 2024 18:34:12 +0000 (14:34 -0400)
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>
gdb/jit.c
gdb/objfiles.c
gdb/objfiles.h
gdb/symfile.c

index 797be95a8dac8540f4ea3af875c5f6939dae0574..2744d03f8f8dd88da814deb3c5f2251852f0b882 100644 (file)
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -660,8 +660,8 @@ jit_object_close_impl (struct gdb_symbol_callbacks *cb,
                     paddress (priv_data->gdbarch,
                               priv_data->entry.symfile_addr));
 
-  objfile *objfile = objfile::make (nullptr, objfile_name.c_str (),
-                                   OBJF_NOT_FILENAME);
+  objfile *objfile = objfile::make (nullptr, current_program_space,
+                                   objfile_name.c_str (), OBJF_NOT_FILENAME);
   objfile->per_bfd->gdbarch = priv_data->gdbarch;
 
   for (gdb_symtab &symtab : obj->symtabs)
index 2d6a49ce54319c8fe020f9b57327081f8f18a72a..0e076fe36be2ef1c4074871ce639075cff0db05d 100644 (file)
@@ -442,8 +442,8 @@ add_separate_debug_objfile (struct objfile *objfile, struct objfile *parent)
 /* See objfiles.h.  */
 
 objfile *
-objfile::make (gdb_bfd_ref_ptr bfd_, const char *name_, objfile_flags flags_,
-              objfile *parent)
+objfile::make (gdb_bfd_ref_ptr bfd_, program_space *pspace, const char *name_,
+              objfile_flags flags_, objfile *parent)
 {
   objfile *result
     = new objfile (std::move (bfd_), current_program_space, name_, flags_);
index e43669c995960bfa28172615ce1d18ff7e57b3b6..50bd6f8dde5f39d446a22afa90527fad082d900e 100644 (file)
@@ -437,8 +437,9 @@ public:
   ~objfile ();
 
   /* Create an objfile.  */
-  static objfile *make (gdb_bfd_ref_ptr bfd_, const char *name_,
-                       objfile_flags flags_, objfile *parent = nullptr);
+  static objfile *make (gdb_bfd_ref_ptr bfd_, program_space *pspace,
+                       const char *name_, objfile_flags flags_,
+                       objfile *parent = nullptr);
 
   /* Remove this objfile from its program space's objfile list, and frees
      it.  */
index caf0aa64d5c9e378956d62bd083a16c33ffd0f9e..2526998649e09c64ea0ee1d8fa366be82e19d2c8 100644 (file)
@@ -1026,7 +1026,6 @@ symbol_file_add_with_addrs (const gdb_bfd_ref_ptr &abfd, const char *name,
                            section_addr_info *addrs,
                            objfile_flags flags, struct objfile *parent)
 {
-  struct objfile *objfile;
   const int from_tty = add_flags & SYMFILE_VERBOSE;
   const int mainline = add_flags & SYMFILE_MAINLINE;
   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)
     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
      symbol table file which has not had initial symbol reading