[PATCH 3/4] gdbsupport/intrusive-list: add owning_intrusive_list

Keith Seitz keiths@redhat.com
Thu Sep 12 22:55:22 GMT 2024


Hi,

On 8/12/24 10:09 AM, Simon Marchi wrote:
> It occured to me that `intrusive_list<solib>`, as returned by
> `solib_ops::current_sos`, for instance, is not very safe.  The
> current_sos method returns the ownership of the solib objects
> (heap-allocated) to its caller, but the `intrusive_list<solib>` type
> does not convey it.  If a function is building an
> `intrusive_list<solib>` and something throws, the solibs won't
> automatically be deleted.  Introduce owning_intrusive_list to fill this
> gap.

I can't/won't speak for others, but this is a welcome change which makes
it explicit who owns what where. I do not see any issues/LGTM.

Reviewed-by: Keith Seitz <keiths@redhat.com>

Keith



More information about the Gdb-patches mailing list