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.c | |
parent | 5e5ac9a570c5aeff695c0663f6cf7f91a6cb50c9 (diff) | |
download | binutils-5965e02896b242f2ffe086def9c83a205eef31aa.zip binutils-5965e02896b242f2ffe086def9c83a205eef31aa.tar.gz binutils-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.c')
-rw-r--r-- | gdb/remote.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index a9ef297..6ac3f51 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -425,6 +425,9 @@ struct remote_state threadref echo_nextthread; threadref nextthread; threadref resultthreadlist[MAXTHREADLISTRESULTS]; + + /* The state of remote notification. */ + struct remote_notif_state *notif_state; }; /* Private data that we'll store in (struct thread_info)->private. */ @@ -3073,7 +3076,7 @@ remote_close (void) if (remote_async_inferior_event_token) delete_async_event_handler (&remote_async_inferior_event_token); - remote_notif_unregister_async_event_handler (); + remote_notif_state_xfree (rs->notif_state); trace_reset_local_state (); } @@ -4337,7 +4340,7 @@ remote_open_1 (char *name, int from_tty, remote_async_inferior_event_token = create_async_event_handler (remote_async_inferior_event_handler, NULL); - remote_notif_register_async_event_handler (); + rs->notif_state = remote_notif_state_allocate (); /* Reset the target state; these things will be queried either by remote_query_supported or as they are needed. */ @@ -4931,7 +4934,7 @@ remote_resume (struct target_ops *ops, before resuming inferior, because inferior was stopped and no RSP traffic at that moment. */ if (!non_stop) - remote_notif_process (¬if_client_stop); + remote_notif_process (rs->notif_state, ¬if_client_stop); rs->last_sent_signal = siggnal; rs->last_sent_step = step; @@ -7352,7 +7355,7 @@ putpkt_binary (char *buf, int cnt) str); do_cleanups (old_chain); } - handle_notification (rs->buf); + handle_notification (rs->notif_state, rs->buf); /* We're in sync now, rewait for the ack. */ tcount = 0; } @@ -7738,7 +7741,7 @@ getpkt_or_notif_sane_1 (char **buf, long *sizeof_buf, int forever, if (is_notif != NULL) *is_notif = 1; - handle_notification (*buf); + handle_notification (rs->notif_state, *buf); /* Notifications require no acknowledgement. */ |