]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: make objfile::make actually use its pspace parameter
authorSimon Marchi <simon.marchi@polymtl.ca>
Fri, 6 Dec 2024 17:50:51 +0000 (12:50 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Fri, 6 Dec 2024 17:52:23 +0000 (12:52 -0500)
Fix an oversight in commit 8991986e2413 ("gdb: pass program space to
objfile::make").

Change-Id: I263eec6e94dde0a9763f831d2d87b4d300b6a36a

gdb/objfiles.c

index 207a0cb22eb0daffde1f8365202c746b15dfc40c..76d17f548a58101d42c33c46cf534fbfb593a91e 100644 (file)
@@ -389,16 +389,14 @@ objfile *
 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_);
+  objfile *result = new objfile (std::move (bfd_), pspace, name_, flags_);
   if (parent != nullptr)
     add_separate_debug_objfile (result, parent);
 
-  current_program_space->add_objfile (std::unique_ptr<objfile> (result),
-                                     parent);
+  pspace->add_objfile (std::unique_ptr<objfile> (result), parent);
 
   /* Rebuild section map next time we need it.  */
-  get_objfile_pspace_data (current_program_space)->new_objfiles_available = 1;
+  get_objfile_pspace_data (pspace)->new_objfiles_available = 1;
 
   return result;
 }