aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/notif.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-04-07 16:17:40 -0600
committerTom Tromey <tom@tromey.com>2019-04-19 14:29:32 -0600
commitb494cdff6922944383ef4dc20fcc90c4d823d315 (patch)
treecb98e6f414bd464bc5edb3709c1554a39c30620d /gdb/gdbserver/notif.h
parentcf250e36790aaa255bb486e2122bb83c95c7669b (diff)
downloadgdb-b494cdff6922944383ef4dc20fcc90c4d823d315.zip
gdb-b494cdff6922944383ef4dc20fcc90c4d823d315.tar.gz
gdb-b494cdff6922944383ef4dc20fcc90c4d823d315.tar.bz2
Use std::list for event notifications in gdbserver
This changes gdbserver to use std::list rather than common/queue.h for event notifications. gdb/gdbserver/ChangeLog 2019-04-19 Tom Tromey <tom@tromey.com> * server.c (struct vstop_notif): Derive from notif_event. <base>: Remove. (queue_stop_reply): Update. (remove_all_on_match_ptid): Change type. Rewrite. (discard_queued_stop_replies): Rewrite. (in_queued_stop_replies_ptid): Change type. (in_queued_stop_replies): Rewrite. (notif_stop): Update. (queue_stop_reply_callback): Update. (captured_main): Don't call initialize_notif. (push_stop_notification): Update. * notif.c (notif_write_event, handle_notif_ack) (notif_event_enque, notif_push): Update. (notif_event_xfree, initialize_notif): Remove. * notif.h (struct notif_event): Include <list>, not "common/queue.h". (struct notif_server) <queue>: Now a std::list. (notif_event_p): Remove typedef. (initialize_notif): Don't declare. (struct notif_event): Add virtual destructor.
Diffstat (limited to 'gdb/gdbserver/notif.h')
-rw-r--r--gdb/gdbserver/notif.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/gdb/gdbserver/notif.h b/gdb/gdbserver/notif.h
index 7d07679..c052512 100644
--- a/gdb/gdbserver/notif.h
+++ b/gdb/gdbserver/notif.h
@@ -20,19 +20,20 @@
#define GDBSERVER_NOTIF_H
#include "target.h"
-#include "common/queue.h"
+#include <list>
/* Structure holding information related to a single event. We
keep a queue of these to push to GDB. It can be extended if
the event of given notification contains more information. */
-typedef struct notif_event
+struct notif_event
{
- /* C requires that a struct or union has at least one member. */
- char dummy;
-} *notif_event_p;
+ virtual ~notif_event ()
+ {
+ }
-DECLARE_QUEUE_P (notif_event_p);
+ /* No payload needed. */
+};
/* A type notification to GDB. An object of 'struct notif_server'
represents a type of notification. */
@@ -49,7 +50,7 @@ typedef struct notif_server
/* A queue of events to GDB. A new notif_event can be enque'ed
into QUEUE at any appropriate time, and the notif_reply is
deque'ed only when the ack from GDB arrives. */
- QUEUE (notif_event_p) *queue;
+ std::list<notif_event *> queue;
/* Write event EVENT to OWN_BUF. */
void (*write) (struct notif_event *event, char *own_buf);
@@ -64,6 +65,4 @@ void notif_push (struct notif_server *np, struct notif_event *event);
void notif_event_enque (struct notif_server *notif,
struct notif_event *event);
-void initialize_notif (void);
-
#endif /* GDBSERVER_NOTIF_H */