diff options
author | Yao Qi <yao@codesourcery.com> | 2013-10-04 07:32:56 +0000 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2013-10-04 07:32:56 +0000 |
commit | 5965e02896b242f2ffe086def9c83a205eef31aa (patch) | |
tree | 0e8e5774e6cf08043b642ef96aa158c137d4c9ea /gdb/remote-notif.h | |
parent | 5e5ac9a570c5aeff695c0663f6cf7f91a6cb50c9 (diff) | |
download | gdb-5965e02896b242f2ffe086def9c83a205eef31aa.zip gdb-5965e02896b242f2ffe086def9c83a205eef31aa.tar.gz gdb-5965e02896b242f2ffe086def9c83a205eef31aa.tar.bz2 |
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.h | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/gdb/remote-notif.h b/gdb/remote-notif.h index da4fdea..4c3617e 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; |