summaryrefslogtreecommitdiff
path: root/gdb/remote.c
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.c
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.c')
-rw-r--r--gdb/remote.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index a9ef2974ac3..6ac3f511eb0 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 (&notif_client_stop);
+ remote_notif_process (rs->notif_state, &notif_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. */