[8/8] gdb: use objfile->pspace in free_objfile observers

Message ID 20231004022305.298534-9-simon.marchi@polymtl.ca
State New
Headers
Series Split new_objfile observable |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed

Commit Message

Simon Marchi Oct. 4, 2023, 2:20 a.m. UTC
  From: Simon Marchi <simon.marchi@efficios.com>

Use objfile->pspace instead of current_program_space.

Change-Id: I127a1788e155b321563114452ed5b530f1d1f618
---
 gdb/solib.c   | 2 +-
 gdb/symfile.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/gdb/solib.c b/gdb/solib.c
index f914822d2096..5280e5ffefd7 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -1739,7 +1739,7 @@  remove_user_added_objfile (struct objfile *objfile)
 {
   if (objfile != 0 && objfile->flags & OBJF_USERLOADED)
     {
-      for (struct so_list *so : current_program_space->solibs ())
+      for (struct so_list *so : objfile->pspace->solibs ())
 	if (so->objfile == objfile)
 	  so->objfile = NULL;
     }
diff --git a/gdb/symfile.c b/gdb/symfile.c
index c2779681cd21..e3228d1925f0 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -3736,7 +3736,7 @@  static void
 symfile_free_objfile (struct objfile *objfile)
 {
   /* Remove the target sections owned by this objfile.  */
-  current_program_space->remove_target_sections (objfile);
+  objfile->pspace->remove_target_sections (objfile);
 }
 
 /* Wrapper around the quick_symbol_functions expand_symtabs_matching "method".