Move notif_queue and remote_async_get_pending_events_token to remote_state
authorYao Qi <yao@codesourcery.com>
Fri, 4 Oct 2013 07:32:56 +0000 (07:32 +0000)
committerYao Qi <yao@codesourcery.com>
Fri, 4 Oct 2013 07:32:56 +0000 (07:32 +0000)
commit5965e02896b242f2ffe086def9c83a205eef31aa
tree0e8e5774e6cf08043b642ef96aa158c137d4c9ea
parent5e5ac9a570c5aeff695c0663f6cf7f91a6cb50c9
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.
gdb/ChangeLog
gdb/remote-notif.c
gdb/remote-notif.h
gdb/remote.c