aboutsummaryrefslogtreecommitdiff
path: root/gdb/solist.h
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2023-10-19 10:55:38 -0400
committerSimon Marchi <simon.marchi@efficios.com>2023-10-19 10:57:51 -0400
commit8971d2788e79db2ffc1205ed36935483eedf2fab (patch)
treeff5dead00b54316d0786af5c6558c41f6407c143 /gdb/solist.h
parent98107b0b17acd9d2c28829cbe93a75b72677d220 (diff)
downloadgdb-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/solist.h')
-rw-r--r--gdb/solist.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/gdb/solist.h b/gdb/solist.h
index 9320acb..e22fd20 100644
--- a/gdb/solist.h
+++ b/gdb/solist.h
@@ -36,7 +36,7 @@ struct lm_info
using lm_info_up = std::unique_ptr<lm_info>;
-struct so_list
+struct so_list : intrusive_list_node<so_list>
{
/* Free symbol-file related contents of SO and reset for possible reloading
of SO. If we have opened a BFD for SO, close it. If we have placed SO's
@@ -52,8 +52,6 @@ struct so_list
dynamic linker's tables in the inferior, and are initialized by
current_sos. */
- struct so_list *next = nullptr; /* next structure in linked list */
-
/* A pointer to target specific link map information. Often this
will be a copy of struct link_map from the user process, but
it need not be; it can be any collection of data needed to
@@ -121,7 +119,7 @@ struct target_so_ops
inferior --- we don't examine any of the shared library files
themselves. The declaration of `struct so_list' says which fields
we provide values for. */
- struct so_list *(*current_sos) (void);
+ intrusive_list<so_list> (*current_sos) ();
/* Find, open, and read the symbols for the main executable. If
FROM_TTY is non-zero, allow messages to be printed. */
@@ -171,8 +169,6 @@ struct target_so_ops
void (*handle_event) (void);
};
-using so_list_range = next_range<so_list>;
-
/* Free the memory associated with a (so_list *). */
void free_so (so_list &so);