]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: pass program space to objfile_purge_solibs
authorSimon Marchi <simon.marchi@polymtl.ca>
Thu, 16 May 2024 19:57:08 +0000 (15:57 -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: I08cfa77a0351c9602131ed2a294eabb1f1f59a6e
Approved-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
gdb/objfiles.c
gdb/objfiles.h
gdb/solib.c

index 822376ba2607eab90874c848fd403ba147ee15c4..56add01daa65f7067ca68d887b5fc7b210b8f6eb 100644 (file)
@@ -784,14 +784,12 @@ have_full_symbols (void)
 }
 
 
-/* This operations deletes all objfile entries that represent solibs that
-   weren't explicitly loaded by the user, via e.g., the add-symbol-file
-   command.  */
+/* See objfiles.h.  */
 
 void
-objfile_purge_solibs (void)
+objfile_purge_solibs (program_space *pspace)
 {
-  for (objfile *objf : current_program_space->objfiles_safe ())
+  for (objfile *objf : pspace->objfiles_safe ())
     {
       /* We assume that the solib package has been purged already, or will
         be soon.  */
index b166f0e877686048da45be4378fc0ef1210a2f46..73d1e991e842ceef6c2c2934ee8475d850cf92f8 100644 (file)
@@ -947,11 +947,11 @@ extern bool is_addr_in_objfile (CORE_ADDR addr, const struct objfile *objfile);
 extern bool shared_objfile_contains_address_p (struct program_space *pspace,
                                               CORE_ADDR address);
 
-/* This operation deletes all objfile entries that represent solibs that
-   weren't explicitly loaded by the user, via e.g., the add-symbol-file
+/* This operation deletes all objfile entries in PSPACE that represent solibs
+   that weren't explicitly loaded by the user, via e.g., the add-symbol-file
    command.  */
 
-extern void objfile_purge_solibs (void);
+extern void objfile_purge_solibs (program_space *pspace);
 
 /* Functions for dealing with the minimal symbol table, really a misc
    address<->symbol mapping for things we don't have debug symbols for.  */
index 55f1c53b99bed44fa5f6473b1882af0887609a8c..7b8e09ac8beb87b40d09419dfc73bda97ea6ebed 100644 (file)
@@ -1248,7 +1248,7 @@ no_shared_libraries (const char *ignored, int from_tty)
      solibs' objfiles before clear_solib has been called.  */
 
   clear_solib (current_program_space);
-  objfile_purge_solibs ();
+  objfile_purge_solibs (current_program_space);
 }
 
 /* See solib.h.  */