From: Simon Marchi Date: Mon, 26 May 2025 20:26:12 +0000 (-0400) Subject: gdb/progspace: rename progspace::so_list, make private X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=87c1d01cadb413ff771e5612d1796bdd0abc80ae;p=thirdparty%2Fbinutils-gdb.git gdb/progspace: rename progspace::so_list, make private Rename the field to m_solib_list, make it private. Update users to go through the accessor. Change-Id: Id720c3a0b1781f4acf31e0dc626f1bd23ed8b39a Reviewed-By: Guinevere Larsen --- diff --git a/gdb/progspace.h b/gdb/progspace.h index 74c1c275b0e..1e08439993a 100644 --- a/gdb/progspace.h +++ b/gdb/progspace.h @@ -233,7 +233,7 @@ struct program_space /* Return the list of all the solibs in this program space. */ owning_intrusive_list &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 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 m_objfiles_list; + /* List of shared objects mapped into this space. Managed by + solib.c. */ + owning_intrusive_list 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 m_target_sections; diff --git a/gdb/solib.c b/gdb/solib.c index 269482d28de..a73f6b9315c 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -765,8 +765,8 @@ update_solib_list (int from_tty) owning_intrusive_list inferior = ops->current_sos (); owning_intrusive_list::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::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);