[pushed] gdb: make objfile::make actually use its pspace parameter

Message ID 20241206175247.499027-1-simark@simark.ca
State New
Headers
Series [pushed] gdb: make objfile::make actually use its pspace parameter |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_build--master-arm fail Patch failed to apply

Commit Message

Simon Marchi Dec. 6, 2024, 5:52 p.m. UTC
  From: Simon Marchi <simon.marchi@polymtl.ca>

Fix an oversight in commit 8991986e2413 ("gdb: pass program space to
objfile::make").

Change-Id: I263eec6e94dde0a9763f831d2d87b4d300b6a36a
---
 gdb/objfiles.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)


base-commit: c8889b9131755888f979f8ee7f238e2acbd54e5b
  

Patch

diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 207a0cb22eb0..76d17f548a58 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -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;
 }