]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/progspace: rename progspace::so_list, make private
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 26 May 2025 20:26:12 +0000 (16:26 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Thu, 29 May 2025 14:44:58 +0000 (10:44 -0400)
Rename the field to m_solib_list, make it private.  Update users to go
through the accessor.

Change-Id: Id720c3a0b1781f4acf31e0dc626f1bd23ed8b39a
Reviewed-By: Guinevere Larsen <guinevere@redhat.com>
gdb/progspace.h
gdb/solib.c

index 74c1c275b0ec64b1e1c64ece65dcc273301cf47d..1e08439993a1500c74db9f37101386f23ce04dfc 100644 (file)
@@ -233,7 +233,7 @@ struct program_space
 
   /* Return the list of all the solibs in this program space.  */
   owning_intrusive_list<solib> &solibs ()
-  { return so_list; }
+  { return m_solib_list; }
 
   /* Similar to `bfd_get_filename (exec_bfd ())` but in original form given
      by user, without symbolic links and pathname resolved.  It is not nullptr
@@ -337,10 +337,6 @@ struct program_space
      (e.g. the argument to the "symbol-file" or "file" command).  */
   struct objfile *symfile_object_file = NULL;
 
-  /* List of shared objects mapped into this space.  Managed by
-     solib.c.  */
-  owning_intrusive_list<solib> so_list;
-
   /* Number of calls to solib_add.  */
   unsigned int solib_add_generation = 0;
 
@@ -359,6 +355,10 @@ private:
   /* All known objfiles are kept in a linked list.  */
   owning_intrusive_list<objfile> m_objfiles_list;
 
+  /* List of shared objects mapped into this space.  Managed by
+     solib.c.  */
+  owning_intrusive_list<solib> m_solib_list;
+
   /* The set of target sections matching the sections mapped into
      this program space.  Managed by both exec_ops and solib.c.  */
   std::vector<target_section> m_target_sections;
index 269482d28debc5b0f072063a56204176bc86b6c8..a73f6b9315c0625d73b0d04301c1c2a4a38ae73d 100644 (file)
@@ -765,8 +765,8 @@ update_solib_list (int from_tty)
 
   owning_intrusive_list<solib> inferior = ops->current_sos ();
   owning_intrusive_list<solib>::iterator gdb_iter
-    = current_program_space->so_list.begin ();
-  while (gdb_iter != current_program_space->so_list.end ())
+    = current_program_space->solibs ().begin ();
+  while (gdb_iter != current_program_space->solibs ().end ())
     {
       intrusive_list<solib>::iterator inferior_iter = inferior.begin ();
 
@@ -820,7 +820,7 @@ update_solib_list (int from_tty)
             sections from so.abfd; remove them.  */
          current_program_space->remove_target_sections (&*gdb_iter);
 
-         gdb_iter = current_program_space->so_list.erase (gdb_iter);
+         gdb_iter = current_program_space->solibs ().erase (gdb_iter);
        }
     }
 
@@ -861,7 +861,7 @@ update_solib_list (int from_tty)
        }
 
       /* Add the new shared objects to GDB's list.  */
-      current_program_space->so_list.splice (std::move (inferior));
+      current_program_space->solibs ().splice (std::move (inferior));
 
       /* If a library was not found, issue an appropriate warning
         message.  We have to use a single call to warning in case the
@@ -1265,7 +1265,7 @@ solib_contains_address_p (const solib &solib, CORE_ADDR address)
 const char *
 solib_name_from_address (struct program_space *pspace, CORE_ADDR address)
 {
-  for (const solib &so : pspace->so_list)
+  for (const solib &so : pspace->solibs ())
     if (solib_contains_address_p (so, address))
       return so.name.c_str ();
 
@@ -1292,7 +1292,7 @@ clear_solib (program_space *pspace)
 {
   const solib_ops *ops = gdbarch_so_ops (current_inferior ()->arch ());
 
-  for (solib &so : pspace->so_list)
+  for (solib &so : pspace->solibs ())
     {
       bool still_in_use
        = (so.objfile != nullptr && solib_used (pspace, so));
@@ -1301,7 +1301,7 @@ clear_solib (program_space *pspace)
       pspace->remove_target_sections (&so);
     };
 
-  pspace->so_list.clear ();
+  pspace->solibs ().clear ();
 
   if (ops->clear_solib != nullptr)
     ops->clear_solib (pspace);