]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Complete use of unique_ptr with notif_event and stop_reply
authorPedro Alves <pedro@palves.net>
Thu, 9 Nov 2023 21:22:15 +0000 (21:22 +0000)
committerPedro Alves <pedro@palves.net>
Wed, 20 Dec 2023 20:04:16 +0000 (20:04 +0000)
commite21633812306a23d454e1a63fa57a5b689cddcbb
treeeecf6036accd93412d1d1ee77c3ccae63a404627
parentd5cebea18e7a9a927f4dd4915d093feb7df0e029
Complete use of unique_ptr with notif_event and stop_reply

We already use unique_ptr with notif_event and stop_reply in some
places around the remote target, but not fully.  There are several
code paths that still use raw pointers.  This commit makes all of the
ownership of these objects tracked by unique pointers, making the
lifetime flow much more obvious, IMHO.

I notice that it fixes a leak -- in remote_notif_stop_ack, We weren't
destroying the stop_reply object if it was of TARGET_WAITKIND_IGNORE
kind.

Approved-By: Tom Tromey <tom@tromey.com>
Change-Id: Id81daf39653d8792c8795b2a145772176bfae77c
gdb/remote-notif.c
gdb/remote-notif.h
gdb/remote.c