summaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-08-14 18:16:30 +0000
committerTom Tromey <tromey@redhat.com>2013-08-14 18:16:30 +0000
commitc4ff6240497bed84d87ad36114762fbe6749e390 (patch)
tree726a3a06e4763e51dce01459f18585f36b44093e /gdb/remote.c
parent314476b193adb1ccc41f8a8580961e76a5a5c354 (diff)
downloadgdb-c4ff6240497bed84d87ad36114762fbe6749e390.tar.gz
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.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index 0fa5fcdbc7d..469d8a49c52 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -401,6 +401,10 @@ struct remote_state
and set to false when the target fails to recognize it). */
int use_threadinfo_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. */
@@ -11635,17 +11639,16 @@ remote_is_async_p (void)
will be able to delay notifying the client of an event until the
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 void
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
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
@@ -11662,9 +11665,9 @@ remote_async (void (*callback) (enum inferior_event_type event_type,
if (callback != NULL)
{
- serial_async (rs->remote_desc, remote_async_serial_handler, NULL);
- async_client_callback = callback;
- async_client_context = context;
+ serial_async (rs->remote_desc, remote_async_serial_handler, rs);
+ rs->async_client_callback = callback;
+ rs->async_client_context = context;
}
else
serial_async (rs->remote_desc, NULL, NULL);