]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb/solib: use owning_intrusive_list for solib list
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 12 Aug 2024 17:09:05 +0000 (13:09 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Fri, 13 Sep 2024 11:38:56 +0000 (07:38 -0400)
commitedb09798f2cd60b72591da9fe5f2e1bee50c5d83
tree7206d3d1487dd5410317356f42fade2b9d76d29d
parent8b8f98ad2badcd859f429dd9c735671985aff762
gdb/solib: use owning_intrusive_list for solib list

Functions implementing `solib_ops::current_sos` return a list of solib
object, transferring the ownership to their callers.  However, the
return type, `intrusive_list<solib>`, does not reflect that.

Also, some of these functions build these lists incrementally, reading
this from the target for each solib.  If a target read were to throw,
for instance, the already created solibs would just be leaked.

Change `solib_ops::current_sos` to return an owning_intrusive_list to
address that.  Change `program_space::so_list` to be an
owning_intrusive_list as well.  This also saves us doing a few manual
deletes.

Change-Id: I6e4071d49744874491625075136c59cce8e608d4
Reviewed-by: Keith Seitz <keiths@redhat.com>
gdb/progspace.h
gdb/solib-aix.c
gdb/solib-darwin.c
gdb/solib-dsbt.c
gdb/solib-frv.c
gdb/solib-rocm.c
gdb/solib-svr4.c
gdb/solib-target.c
gdb/solib.c
gdb/solist.h