move async_client_callback and async_client_context into remote_state

This moves async_client_callback and async_client_context into
remote_state.

	* remote.c (struct remote_state) <async_client_callback,
	async_client_context>: New fields.
	(async_client_callback, async_client_context): Remove.
	(remote_async_serial_handler, remote_async): Update.
This commit is contained in:
Tom Tromey 2013-08-14 18:16:30 +00:00
parent 2f65bcb75d
commit 88b496c367
2 changed files with 17 additions and 7 deletions

View File

@ -1,3 +1,10 @@
2013-08-14 Tom Tromey <tromey@redhat.com>
* remote.c (struct remote_state) <async_client_callback,
async_client_context>: New fields.
(async_client_callback, async_client_context): Remove.
(remote_async_serial_handler, remote_async): Update.
2013-08-14 Tom Tromey <tromey@redhat.com> 2013-08-14 Tom Tromey <tromey@redhat.com>
* remote.c (sizeof_pkt): Remove. * remote.c (sizeof_pkt): Remove.

View File

@ -401,6 +401,10 @@ struct remote_state
and set to false when the target fails to recognize it). */ and set to false when the target fails to recognize it). */
int use_threadinfo_query; int use_threadinfo_query;
int use_threadextra_query; int use_threadextra_query;
void (*async_client_callback) (enum inferior_event_type event_type,
void *context);
void *async_client_context;
}; };
/* Private data that we'll store in (struct thread_info)->private. */ /* Private data that we'll store in (struct thread_info)->private. */
@ -11635,17 +11639,16 @@ remote_is_async_p (void)
will be able to delay notifying the client of an event until the will be able to delay notifying the client of an event until the
point where an entire packet has been received. */ point where an entire packet has been received. */
static void (*async_client_callback) (enum inferior_event_type event_type,
void *context);
static void *async_client_context;
static serial_event_ftype remote_async_serial_handler; static serial_event_ftype remote_async_serial_handler;
static void static void
remote_async_serial_handler (struct serial *scb, void *context) remote_async_serial_handler (struct serial *scb, void *context)
{ {
struct remote_state *rs = context;
/* Don't propogate error information up to the client. Instead let /* Don't propogate error information up to the client. Instead let
the client find out about the error by querying the target. */ the client find out about the error by querying the target. */
async_client_callback (INF_REG_EVENT, async_client_context); rs->async_client_callback (INF_REG_EVENT, rs->async_client_context);
} }
static void static void
@ -11662,9 +11665,9 @@ remote_async (void (*callback) (enum inferior_event_type event_type,
if (callback != NULL) if (callback != NULL)
{ {
serial_async (rs->remote_desc, remote_async_serial_handler, NULL); serial_async (rs->remote_desc, remote_async_serial_handler, rs);
async_client_callback = callback; rs->async_client_callback = callback;
async_client_context = context; rs->async_client_context = context;
} }
else else
serial_async (rs->remote_desc, NULL, NULL); serial_async (rs->remote_desc, NULL, NULL);