diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2023-10-19 10:55:38 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2023-10-19 10:57:51 -0400 |
commit | 8971d2788e79db2ffc1205ed36935483eedf2fab (patch) | |
tree | ff5dead00b54316d0786af5c6558c41f6407c143 /gdb/progspace.h | |
parent | 98107b0b17acd9d2c28829cbe93a75b72677d220 (diff) | |
download | gdb-8971d2788e79db2ffc1205ed36935483eedf2fab.zip gdb-8971d2788e79db2ffc1205ed36935483eedf2fab.tar.gz gdb-8971d2788e79db2ffc1205ed36935483eedf2fab.tar.bz2 |
gdb: link so_list using intrusive_list
Replace the hand-made linked list implementation with intrusive_list,
simplying management of list items.
Change-Id: I7f55fd88325bb197cc655c9be5a2ec966d8cc48d
Approved-By: Pedro Alves <pedro@palves.net>
Reviewed-By: Reviewed-By: Lancelot Six <lancelot.six@amd.com>
Diffstat (limited to 'gdb/progspace.h')
-rw-r--r-- | gdb/progspace.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/gdb/progspace.h b/gdb/progspace.h index 20dfc2e..0a762e6 100644 --- a/gdb/progspace.h +++ b/gdb/progspace.h @@ -28,6 +28,7 @@ #include "solist.h" #include "gdbsupport/next-iterator.h" #include "gdbsupport/safe-iterator.h" +#include "gdbsupport/intrusive_list.h" #include <list> #include <vector> @@ -253,12 +254,9 @@ struct program_space is outside all objfiles in this progspace. */ struct objfile *objfile_for_address (CORE_ADDR address); - /* Return a range adapter for iterating over all the solibs in this - program space. Use it like: - - for (so_list *so : pspace->solibs ()) { ... } */ - so_list_range solibs () const - { return so_list_range (this->so_list); } + /* Return the list of all the solibs in this program space. */ + intrusive_list<struct so_list> &solibs () + { return so_list; } /* Close and clear exec_bfd. If we end up with no target sections to read memory from, this unpushes the exec_ops target. */ @@ -361,7 +359,7 @@ struct program_space /* List of shared objects mapped into this space. Managed by solib.c. */ - struct so_list *so_list = NULL; + intrusive_list<struct so_list> so_list; /* Number of calls to solib_add. */ unsigned int solib_add_generation = 0; |