summaryrefslogtreecommitdiff
path: root/gdb/solib-svr4.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-05-08 14:21:22 -0600
committerTom Tromey <tromey@adacore.com>2020-05-08 14:21:22 -0600
commita1fd1ac9def557cbb7570cf90178a00cb26e7fef (patch)
tree2ba2b212b672aef86649fdb3ae6e3668cc49ada2 /gdb/solib-svr4.c
parent38eae084598a3531bef4b7987a8fe646ae92a988 (diff)
Remove ALL_SO_LIBS and so_list_head
This patch started as an attempt to replace ALL_SO_LIBS with an ordinary C++ iterator. However, then I tripped over the so_list_head define again, and decided to remove it as well. gdb/ChangeLog 2020-05-08 Tom Tromey <tom@tromey.com> * mi/mi-cmd-file.c (mi_cmd_file_list_shared_libraries): Update. * solib-svr4.c (svr4_fetch_objfile_link_map): Update. (enable_break): Update. * solib-frv.c (frv_fdpic_find_global_pointer): Update. (frv_fdpic_find_canonical_descriptor): Update. (frv_fetch_objfile_link_map): Update. * progspace.c (program_space::free_all_objfiles): Update. (program_space::solibs): New method. * progspace.h (struct program_space) <solibs>: New method. * solist.h (master_so_list): Don't declare. (ALL_SO_LIBS): Remove. * solib.h (so_list_head): Remove. (update_solib_list): Update comment. * solib.c (master_so_list): Remove. (solib_used, update_solib_list, solib_add) (info_sharedlibrary_command, clear_solib) (reload_shared_libraries_1, remove_user_added_objfile): Update.
Diffstat (limited to 'gdb/solib-svr4.c')
-rw-r--r--gdb/solib-svr4.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index 38c832f8f5..19d1105ae9 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -1537,7 +1537,6 @@ svr4_current_sos (void)
CORE_ADDR
svr4_fetch_objfile_link_map (struct objfile *objfile)
{
- struct so_list *so;
struct svr4_info *info = get_svr4_info (objfile->pspace);
/* Cause svr4_current_sos() to be run if it hasn't been already. */
@@ -1555,7 +1554,7 @@ svr4_fetch_objfile_link_map (struct objfile *objfile)
/* The other link map addresses may be found by examining the list
of shared libraries. */
- for (so = master_so_list (); so; so = so->next)
+ for (struct so_list *so : current_program_space->solibs ())
if (so->objfile == objfile)
{
lm_info_svr4 *li = (lm_info_svr4 *) so->lm_info;
@@ -2307,7 +2306,6 @@ enable_break (struct svr4_info *info, int from_tty)
CORE_ADDR load_addr = 0;
int load_addr_found = 0;
int loader_found_in_list = 0;
- struct so_list *so;
struct target_ops *tmp_bfd_target;
sym_addr = 0;
@@ -2340,8 +2338,7 @@ enable_break (struct svr4_info *info, int from_tty)
/* On a running target, we can get the dynamic linker's base
address from the shared library table. */
- so = master_so_list ();
- while (so)
+ for (struct so_list *so : current_program_space->solibs ())
{
if (svr4_same_1 (interp_name, so->so_original_name))
{
@@ -2350,7 +2347,6 @@ enable_break (struct svr4_info *info, int from_tty)
load_addr = lm_addr_check (so, tmp_bfd.get ());
break;
}
- so = so->next;
}
/* If we were not able to find the base address of the loader