aboutsummaryrefslogtreecommitdiff
path: root/gdb/target-delegates.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2015-03-25 11:28:31 +0000
committerPedro Alves <palves@redhat.com>2015-03-25 11:28:31 +0000
commit6a3753b34b7b4ff6b12d89ec1f6835799b54ef63 (patch)
tree05f89037559d7367772ca73dc5305f051ae92936 /gdb/target-delegates.c
parent1c4b552ba553c4dbbb066c9ef8667209553444ca (diff)
Simplify target_async hook interface
All callers of target_async pass it the same callback (inferior_event_handler). Since both common code and target backends need to be able to put the target in and out of target async mode at any given time, there's really no way that a different callback could be passed. This commit simplifies things, and removes the indirection altogether. Bonus: with this, gdb's target_async method ends up with the same signature as gdbserver's. Tested on x86_64 Fedora 20, native and gdbserver. gdb/ChangeLog: 2015-03-25 Pedro Alves <palves@redhat.com> * target.h <to_async>: Replace 'callback' and 'context' parameters with boolean 'enable' parameter. (target_async): Replace CALLBACK and CONTEXT parameters with boolean ENABLE parameter. * inf-loop.c (inferior_event_handler): Adjust. * linux-nat.c (linux_nat_attach, linux_nat_resume) (linux_nat_resume): Adjust. (async_client_callback, async_client_context): Delete. (handle_target_event): Call inferior_event_handler directly. (linux_nat_async): Replace 'callback' and 'context' parameters with boolean 'enable' parameter. Adjust. Remove references to async_client_callback and async_client_context. (linux_nat_close): Adjust. * record-btrace.c (record_btrace_async): Replace 'callback' and 'context' parameters with boolean 'enable' parameter. Adjust. (record_btrace_resume): Adjust. * record-full.c (record_full_async): Replace 'callback' and 'context' parameters with boolean 'enable' parameter. Adjust. (record_full_resume, record_full_core_resume): Adjust. * remote.c (struct remote_state) <async_client_callback, async_client_context>: Delete fields. (remote_start_remote, extended_remote_attach_1, remote_resume) (extended_remote_create_inferior): Adjust. (remote_async_serial_handler): Call inferior_event_handler directly. (remote_async): Replace 'callback' and 'context' parameters with boolean 'enable' parameter. Adjust. * top.c (gdb_readline_wrapper_cleanup, gdb_readline_wrapper): Adjust. * target-delegates.c: Regenerate.
Diffstat (limited to 'gdb/target-delegates.c')
-rw-r--r--gdb/target-delegates.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c
index 0c1309a9aa..b29abaf5b3 100644
--- a/gdb/target-delegates.c
+++ b/gdb/target-delegates.c
@@ -1692,29 +1692,27 @@ debug_is_async_p (struct target_ops *self)
}
static void
-delegate_async (struct target_ops *self, async_callback_ftype *arg1, void *arg2)
+delegate_async (struct target_ops *self, int arg1)
{
self = self->beneath;
- self->to_async (self, arg1, arg2);
+ self->to_async (self, arg1);
}
static void
-tdefault_async (struct target_ops *self, async_callback_ftype *arg1, void *arg2)
+tdefault_async (struct target_ops *self, int arg1)
{
tcomplain ();
}
static void
-debug_async (struct target_ops *self, async_callback_ftype *arg1, void *arg2)
+debug_async (struct target_ops *self, int arg1)
{
fprintf_unfiltered (gdb_stdlog, "-> %s->to_async (...)\n", debug_target.to_shortname);
- debug_target.to_async (&debug_target, arg1, arg2);
+ debug_target.to_async (&debug_target, arg1);
fprintf_unfiltered (gdb_stdlog, "<- %s->to_async (", debug_target.to_shortname);
target_debug_print_struct_target_ops_p (&debug_target);
fputs_unfiltered (", ", gdb_stdlog);
- target_debug_print_async_callback_ftype_p (arg1);
- fputs_unfiltered (", ", gdb_stdlog);
- target_debug_print_void_p (arg2);
+ target_debug_print_int (arg1);
fputs_unfiltered (")\n", gdb_stdlog);
}