gdb: fix stale references to so_list

Adjust some comments and function names that refer to the ancient
so_list type.

Update some other stale comments in solib-svr4.c at the same time.

Change-Id: Ia42efa6554d0cc6abb4183b6bffc96c6358c5735
Reviewed-By: Guinevere Larsen <guinevere@redhat.com>
This commit is contained in:
Simon Marchi
2025-05-26 16:26:11 -04:00
committed by Simon Marchi
parent 6896e62513
commit cba1c145af
11 changed files with 27 additions and 27 deletions

View File

@@ -231,7 +231,7 @@ struct program_space
is outside all objfiles in this progspace. */
struct objfile *objfile_for_address (CORE_ADDR address);
/* Return the list of all the solibs in this program space. */
/* Return the list of all the solibs in this program space. */
owning_intrusive_list<solib> &solibs ()
{ return so_list; }

View File

@@ -133,7 +133,7 @@ darwin_load_image_infos (struct darwin_info *info)
(buf + 8 + ptr_type->length (), ptr_type);
}
/* Link map info to include in an allocated so_list entry. */
/* Link map info to include in an allocated solib entry. */
struct lm_info_darwin final : public lm_info
{

View File

@@ -121,7 +121,7 @@ struct dbst_ext_link_map
ext_ptr l_next, l_prev; /* struct link_map *l_next, *l_prev; */
};
/* Link map info to include in an allocated so_list entry */
/* Link map info to include in an allocated solib entry */
struct lm_info_dsbt final : public lm_info
{

View File

@@ -194,7 +194,7 @@ struct ext_link_map
ext_ptr l_next, l_prev; /* struct link_map *l_next, *l_prev; */
};
/* Link map info to include in an allocated so_list entry. */
/* Link map info to include in an allocated solib entry. */
struct lm_info_frv final : public lm_info
{

View File

@@ -202,10 +202,10 @@ rocm_solib_handle_event ()
rocm_update_solib_list ();
}
/* Create so_list objects from rocm_so objects in SOS. */
/* Create solib objects from rocm_so objects in SOS. */
static owning_intrusive_list<solib>
so_list_from_rocm_sos (const std::vector<rocm_so> &sos)
solibs_from_rocm_sos (const std::vector<rocm_so> &sos)
{
owning_intrusive_list<solib> dst;
@@ -236,13 +236,13 @@ rocm_solib_current_sos ()
if (dev_sos.empty ())
return sos;
owning_intrusive_list<solib> dev_so_list = so_list_from_rocm_sos (dev_sos);
owning_intrusive_list<solib> dev_solibs = solibs_from_rocm_sos (dev_sos);
if (sos.empty ())
return dev_so_list;
return dev_solibs;
/* Append our libraries to the end of the list. */
sos.splice (std::move (dev_so_list));
sos.splice (std::move (dev_solibs));
return sos;
}

View File

@@ -1046,10 +1046,10 @@ svr4_clear_so (const solib &so)
li->l_addr_p = 0;
}
/* Create the so_list objects equivalent to the svr4_sos in SOS. */
/* Create the solib objects equivalent to the svr4_sos in SOS. */
static owning_intrusive_list<solib>
so_list_from_svr4_sos (const std::vector<svr4_so> &sos)
solib_from_svr4_sos (const std::vector<svr4_so> &sos)
{
owning_intrusive_list<solib> dst;
@@ -1176,11 +1176,10 @@ static const struct gdb_xml_element svr4_library_list_elements[] =
{ NULL, NULL, NULL, GDB_XML_EF_NONE, NULL, NULL }
};
/* Parse qXfer:libraries:read packet into *SO_LIST_RETURN. Return 1 if
/* Parse qXfer:libraries:read packet into *LIST.
Return 0 if packet not supported, *SO_LIST_RETURN is not modified in such
case. Return 1 if *SO_LIST_RETURN contains the library list, it may be
empty, caller is responsible for freeing all its entries. */
Return 0 if packet not supported, *LIST is not modified in such case.
Return 1 if *LIST contains the library list. */
static int
svr4_parse_libraries (const char *document, struct svr4_library_list *list)
@@ -1202,11 +1201,11 @@ svr4_parse_libraries (const char *document, struct svr4_library_list *list)
return 0;
}
/* Attempt to get so_list from target via qXfer:libraries-svr4:read packet.
/* Attempt to get the shared object list from target via
qXfer:libraries-svr4:read packet.
Return 0 if packet not supported, *SO_LIST_RETURN is not modified in such
case. Return 1 if *SO_LIST_RETURN contains the library list, it may be
empty, caller is responsible for freeing all its entries.
Return 0 if packet not supported, *LIST is not modified in such case.
Return 1 if *LIST contains the library list.
Note that ANNEX must be NULL if the remote does not explicitly allow
qXfer:libraries-svr4:read packets with non-empty annexes. Support for
@@ -1450,7 +1449,7 @@ svr4_collect_probes_sos (svr4_info *info)
for (const auto &tuple : info->solib_lists)
{
const std::vector<svr4_so> &sos = tuple.second;
res.splice (so_list_from_svr4_sos (sos));
res.splice (solib_from_svr4_sos (sos));
}
return res;

View File

@@ -27,7 +27,7 @@ struct solib_ops;
extern const solib_ops svr4_so_ops;
/* Link map info to include in an allocated so_list entry. */
/* Link map info to include in an allocated solib entry. */
struct lm_info_svr4 final : public lm_info
{

View File

@@ -30,7 +30,7 @@
struct lm_info_target final : public lm_info
{
/* The library's name. The name is normally kept in the struct
so_list; it is only here during XML parsing. */
solib; it is only here during XML parsing. */
std::string name;
/* The target can either specify segment bases or section bases, not

View File

@@ -1480,7 +1480,7 @@ reload_shared_libraries (const char *ignored, int from_tty,
if (target_has_execution ())
{
/* Reset or free private data structures not associated with
so_list entries. */
solib entries. */
if (ops->clear_solib != nullptr)
ops->clear_solib (current_program_space);

View File

@@ -89,7 +89,8 @@ extern void no_shared_libraries (program_space *pspace);
Extract the list of currently loaded shared objects from the
inferior, and compare it with the list of shared objects in the
current program space's list of shared libraries. Edit
so_list_head to bring it in sync with the inferior's new list.
the current program space's solib list to bring it in sync with the
inferior's new list.
If we notice that the inferior has unloaded some shared objects,
free any symbolic info GDB had read about those shared objects.

View File

@@ -109,7 +109,7 @@ struct solib_ops
void (*clear_so) (const solib &so);
/* Free private data structures associated to PSPACE. This method
should not free resources associated to individual so_list entries,
should not free resources associated to individual solib entries,
those are cleared by the clear_so method. */
void (*clear_solib) (program_space *pspace);
@@ -136,7 +136,7 @@ struct solib_ops
/* Find and open shared library binary file. */
gdb_bfd_ref_ptr (*bfd_open) (const char *pathname);
/* Given two so_list objects, one from the GDB thread list
/* Given two solib objects, one from the GDB thread list
and another from the list returned by current_sos, return 1
if they represent the same library.
Falls back to using strcmp on ORIGINAL_NAME when set to nullptr. */
@@ -199,7 +199,7 @@ struct solib_ops
std::vector<const solib *> (*get_solibs_in_ns) (int ns);
};
/* A unique pointer to a so_list. */
/* A unique pointer to an solib. */
using solib_up = std::unique_ptr<solib>;
/* Find main executable binary file. */