[binutils-gdb] gdb: make objfile::make actually use its pspace parameter

Simon Marchi simark@sourceware.org
Fri Dec 6 17:52:41 GMT 2024


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=137f38de260fc414f42034f0e1c1bf6a1dae4199

commit 137f38de260fc414f42034f0e1c1bf6a1dae4199
Author: Simon Marchi <simon.marchi@polymtl.ca>
Date:   Fri Dec 6 12:50:51 2024 -0500

    gdb: make objfile::make actually use its pspace parameter
    
    Fix an oversight in commit 8991986e2413 ("gdb: pass program space to
    objfile::make").
    
    Change-Id: I263eec6e94dde0a9763f831d2d87b4d300b6a36a

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

diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 207a0cb22eb..76d17f548a5 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;
 }


More information about the Gdb-cvs mailing list