diff options
author | Pedro Alves <pedro@palves.net> | 2023-11-09 21:22:15 +0000 |
---|---|---|
committer | Pedro Alves <pedro@palves.net> | 2023-12-20 20:04:16 +0000 |
commit | e21633812306a23d454e1a63fa57a5b689cddcbb (patch) | |
tree | eecf6036accd93412d1d1ee77c3ccae63a404627 /gdb/remote-notif.h | |
parent | d5cebea18e7a9a927f4dd4915d093feb7df0e029 (diff) | |
download | binutils-e21633812306a23d454e1a63fa57a5b689cddcbb.zip binutils-e21633812306a23d454e1a63fa57a5b689cddcbb.tar.gz binutils-e21633812306a23d454e1a63fa57a5b689cddcbb.tar.bz2 |
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
Diffstat (limited to 'gdb/remote-notif.h')
-rw-r--r-- | gdb/remote-notif.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/remote-notif.h b/gdb/remote-notif.h index c95e1f6..3b09589 100644 --- a/gdb/remote-notif.h +++ b/gdb/remote-notif.h @@ -67,7 +67,7 @@ struct notif_client something wrong, throw an exception. */ void (*ack) (remote_target *remote, const notif_client *self, const char *buf, - struct notif_event *event); + notif_event_up event); /* Check this notification client can get pending events in 'remote_notif_process'. */ @@ -111,14 +111,14 @@ struct remote_notif_state this notification (which is done by remote.c:remote_notif_pending_replies). */ - struct notif_event *pending_event[REMOTE_NOTIF_LAST] {}; + notif_event_up pending_event[REMOTE_NOTIF_LAST]; }; void remote_notif_ack (remote_target *remote, const notif_client *nc, const char *buf); -struct notif_event *remote_notif_parse (remote_target *remote, - const notif_client *nc, - const char *buf); +notif_event_up remote_notif_parse (remote_target *remote, + const notif_client *nc, + const char *buf); void handle_notification (struct remote_notif_state *notif_state, const char *buf); |