summaryrefslogtreecommitdiff
path: root/gdb/remote-notif.h
diff options
context:
space:
mode:
authorqiyao <qiyao>2013-10-04 07:32:56 +0000
committerqiyao <qiyao>2013-10-04 07:32:56 +0000
commit70166e7ad853a415d641fb5222b39953cc20c209 (patch)
tree66e01bad9f9c23bf1d3ccdd99ff19545a977a13d /gdb/remote-notif.h
parent17b0ea1ae0ae3d4dfe714e2c880a9377b8b344c3 (diff)
downloadgdb-70166e7ad853a415d641fb5222b39953cc20c209.tar.gz
Move notif_queue and remote_async_get_pending_events_token to remote_state
This patch also removes notif_xfree, and don't pass it QUEUE_alloc, because we don't have to free notif_client when the remote_notif_state is freed. gdb: 2013-10-04 Yao Qi <yao@codesourcery.com> * remote-notif.c (DECLARE_QUEUE_P): Remove. (notif_queue): Remove. (remote_notif_process): Add one parameter 'notif_queue'. Update comments. Callers update. (remote_async_get_pending_events_token): Remove. (remote_notif_register_async_event_handler): Remove. (remote_notif_unregister_async_event_handler): Remove. (handle_notification): Add parameter 'notif_queue'. Update comments. Callers update. (notif_xfree): Remove. (remote_notif_state_allocate): New function. (remote_notif_state_xfree): New function. (_initialize_notif): Remove code to allocate queue. * remote-notif.h (DECLARE_QUEUE_P): Moved from remote-notif.c. (struct remote_notif_state): New. (handle_notification): Update declaration. (remote_notif_process): Likewise. (remote_notif_register_async_event_handler): Remove. (remote_notif_unregister_async_event_handler): Remove. (remote_notif_state_allocate): Declare. (remote_notif_state_xfree): Declare. * remote.c (struct remote_state) <notif_state>: New field. (remote_close): Don't call remote_notif_unregister_async_event_handler. Call remote_notif_state_xfree. (remote_open_1): Don't call remote_notif_register_async_event_handler. Call remote_notif_state_allocate.
Diffstat (limited to 'gdb/remote-notif.h')
-rw-r--r--gdb/remote-notif.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/gdb/remote-notif.h b/gdb/remote-notif.h
index da4fdea1ce4..4c3617e76dc 100644
--- a/gdb/remote-notif.h
+++ b/gdb/remote-notif.h
@@ -68,16 +68,36 @@ typedef struct notif_client
struct notif_event *pending_event;
} *notif_client_p;
+DECLARE_QUEUE_P (notif_client_p);
+
+/* State on remote async notification. */
+
+struct remote_notif_state
+{
+ /* Notification queue. */
+
+ QUEUE(notif_client_p) *notif_queue;
+
+ /* Asynchronous signal handle registered as event loop source for when
+ the remote sent us a notification. The registered callback
+ will do a ACK sequence to pull the rest of the events out of
+ the remote side into our event queue. */
+
+ struct async_event_handler *get_pending_events_token;
+};
+
void remote_notif_ack (struct notif_client *nc, char *buf);
struct notif_event *remote_notif_parse (struct notif_client *nc,
char *buf);
-void handle_notification (char *buf);
+void handle_notification (struct remote_notif_state *notif_state,
+ char *buf);
-void remote_notif_register_async_event_handler (void);
-void remote_notif_unregister_async_event_handler (void);
+void remote_notif_process (struct remote_notif_state *state,
+ struct notif_client *except);
+struct remote_notif_state *remote_notif_state_allocate (void);
+void remote_notif_state_xfree (struct remote_notif_state *state);
-void remote_notif_process (struct notif_client *except);
extern struct notif_client notif_client_stop;
extern int notif_debug;