C++ify remote notification code
authorTom Tromey <tom@tromey.com>
Thu, 24 Jan 2019 05:16:53 +0000 (22:16 -0700)
committerTom Tromey <tom@tromey.com>
Wed, 6 Mar 2019 23:04:31 +0000 (16:04 -0700)
commit32603266e5688718faad35b7502aa0b72a42764a
treef686b0e4adf854552bacf4aa2079bd9ae6ac0a4b
parent9799571ecb648ea2e911498cfdc7fafe3237c94a
C++ify remote notification code

This C++ifies the remote notification code -- replacing function
pointers with virtual methods and using unique_ptr.  This allows for
the removal of some cleanups.

2019-03-06  Tom Tromey  <tom@tromey.com>

* remote.c (struct stop_reply_deleter): Remove.
(stop_reply_up): Update.
(struct stop_reply): Derive from notif_event.  Don't typedef.
<regcache>: Now a std::vector.
(stop_reply_xfree): Remove.
(stop_reply::~stop_reply): Rename from stop_reply_dtr.
(remote_notif_stop_alloc_reply): Return a unique_ptr.  Use new.
(remote_target::discard_pending_stop_replies): Use delete.
(remote_target::remote_parse_stop_reply): Update.
(remote_target::process_stop_reply): Update.
* remote-notif.h (struct notif_event): Add virtual destructor.
Remove "dtr" member.
(struct notif_client) <alloc_event>: Return a unique_ptr.
(notif_event_xfree): Don't declare.
(notif_event_up): New typedef.
* remote-notif.c (remote_notif_ack, remote_notif_parse): Update.
(notif_event_xfree, do_notif_event_xfree): Remove.
(remote_notif_state_xfree): Update.
gdb/ChangeLog
gdb/remote-notif.c
gdb/remote-notif.h
gdb/remote.c