xtensa: implement NPTL helpers
[binutils-gdb.git] / gdb / target-delegates.c
index 1f827f5125478169ebfc74595fc9e206f848b786..892cf9d0805db0ef3520388e3cf4e6fb75e2d3e1 100644 (file)
@@ -401,20 +401,20 @@ debug_supports_stopped_by_hw_breakpoint (struct target_ops *self)
 }
 
 static int
-delegate_can_use_hw_breakpoint (struct target_ops *self, int arg1, int arg2, int arg3)
+delegate_can_use_hw_breakpoint (struct target_ops *self, enum bptype arg1, int arg2, int arg3)
 {
   self = self->beneath;
   return self->to_can_use_hw_breakpoint (self, arg1, arg2, arg3);
 }
 
 static int
-tdefault_can_use_hw_breakpoint (struct target_ops *self, int arg1, int arg2, int arg3)
+tdefault_can_use_hw_breakpoint (struct target_ops *self, enum bptype arg1, int arg2, int arg3)
 {
   return 0;
 }
 
 static int
-debug_can_use_hw_breakpoint (struct target_ops *self, int arg1, int arg2, int arg3)
+debug_can_use_hw_breakpoint (struct target_ops *self, enum bptype arg1, int arg2, int arg3)
 {
   int result;
   fprintf_unfiltered (gdb_stdlog, "-> %s->to_can_use_hw_breakpoint (...)\n", debug_target.to_shortname);
@@ -422,7 +422,7 @@ debug_can_use_hw_breakpoint (struct target_ops *self, int arg1, int arg2, int ar
   fprintf_unfiltered (gdb_stdlog, "<- %s->to_can_use_hw_breakpoint (", debug_target.to_shortname);
   target_debug_print_struct_target_ops_p (&debug_target);
   fputs_unfiltered (", ", gdb_stdlog);
-  target_debug_print_int (arg1);
+  target_debug_print_enum_bptype (arg1);
   fputs_unfiltered (", ", gdb_stdlog);
   target_debug_print_int (arg2);
   fputs_unfiltered (", ", gdb_stdlog);
@@ -523,20 +523,20 @@ debug_remove_hw_breakpoint (struct target_ops *self, struct gdbarch *arg1, struc
 }
 
 static int
-delegate_remove_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4)
+delegate_remove_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, enum target_hw_bp_type arg3, struct expression *arg4)
 {
   self = self->beneath;
   return self->to_remove_watchpoint (self, arg1, arg2, arg3, arg4);
 }
 
 static int
-tdefault_remove_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4)
+tdefault_remove_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, enum target_hw_bp_type arg3, struct expression *arg4)
 {
   return -1;
 }
 
 static int
-debug_remove_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4)
+debug_remove_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, enum target_hw_bp_type arg3, struct expression *arg4)
 {
   int result;
   fprintf_unfiltered (gdb_stdlog, "-> %s->to_remove_watchpoint (...)\n", debug_target.to_shortname);
@@ -548,7 +548,7 @@ debug_remove_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, int
   fputs_unfiltered (", ", gdb_stdlog);
   target_debug_print_int (arg2);
   fputs_unfiltered (", ", gdb_stdlog);
-  target_debug_print_int (arg3);
+  target_debug_print_enum_target_hw_bp_type (arg3);
   fputs_unfiltered (", ", gdb_stdlog);
   target_debug_print_struct_expression_p (arg4);
   fputs_unfiltered (") = ", gdb_stdlog);
@@ -558,20 +558,20 @@ debug_remove_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, int
 }
 
 static int
-delegate_insert_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4)
+delegate_insert_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, enum target_hw_bp_type arg3, struct expression *arg4)
 {
   self = self->beneath;
   return self->to_insert_watchpoint (self, arg1, arg2, arg3, arg4);
 }
 
 static int
-tdefault_insert_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4)
+tdefault_insert_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, enum target_hw_bp_type arg3, struct expression *arg4)
 {
   return -1;
 }
 
 static int
-debug_insert_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4)
+debug_insert_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, enum target_hw_bp_type arg3, struct expression *arg4)
 {
   int result;
   fprintf_unfiltered (gdb_stdlog, "-> %s->to_insert_watchpoint (...)\n", debug_target.to_shortname);
@@ -583,7 +583,7 @@ debug_insert_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, int
   fputs_unfiltered (", ", gdb_stdlog);
   target_debug_print_int (arg2);
   fputs_unfiltered (", ", gdb_stdlog);
-  target_debug_print_int (arg3);
+  target_debug_print_enum_target_hw_bp_type (arg3);
   fputs_unfiltered (", ", gdb_stdlog);
   target_debug_print_struct_expression_p (arg4);
   fputs_unfiltered (") = ", gdb_stdlog);
@@ -1536,6 +1536,30 @@ debug_stop (struct target_ops *self, ptid_t arg1)
   fputs_unfiltered (")\n", gdb_stdlog);
 }
 
+static void
+delegate_interrupt (struct target_ops *self, ptid_t arg1)
+{
+  self = self->beneath;
+  self->to_interrupt (self, arg1);
+}
+
+static void
+tdefault_interrupt (struct target_ops *self, ptid_t arg1)
+{
+}
+
+static void
+debug_interrupt (struct target_ops *self, ptid_t arg1)
+{
+  fprintf_unfiltered (gdb_stdlog, "-> %s->to_interrupt (...)\n", debug_target.to_shortname);
+  debug_target.to_interrupt (&debug_target, arg1);
+  fprintf_unfiltered (gdb_stdlog, "<- %s->to_interrupt (", debug_target.to_shortname);
+  target_debug_print_struct_target_ops_p (&debug_target);
+  fputs_unfiltered (", ", gdb_stdlog);
+  target_debug_print_ptid_t (arg1);
+  fputs_unfiltered (")\n", gdb_stdlog);
+}
+
 static void
 delegate_rcmd (struct target_ops *self, const char *arg1, struct ui_file *arg2)
 {
@@ -1692,29 +1716,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);
 }
 
@@ -1745,6 +1767,33 @@ debug_supports_non_stop (struct target_ops *self)
   return result;
 }
 
+static int
+delegate_always_non_stop_p (struct target_ops *self)
+{
+  self = self->beneath;
+  return self->to_always_non_stop_p (self);
+}
+
+static int
+tdefault_always_non_stop_p (struct target_ops *self)
+{
+  return 0;
+}
+
+static int
+debug_always_non_stop_p (struct target_ops *self)
+{
+  int result;
+  fprintf_unfiltered (gdb_stdlog, "-> %s->to_always_non_stop_p (...)\n", debug_target.to_shortname);
+  result = debug_target.to_always_non_stop_p (&debug_target);
+  fprintf_unfiltered (gdb_stdlog, "<- %s->to_always_non_stop_p (", debug_target.to_shortname);
+  target_debug_print_struct_target_ops_p (&debug_target);
+  fputs_unfiltered (") = ", gdb_stdlog);
+  target_debug_print_int (result);
+  fputs_unfiltered ("\n", gdb_stdlog);
+  return result;
+}
+
 static int
 delegate_find_memory_regions (struct target_ops *self, find_memory_region_ftype arg1, void *arg2)
 {
@@ -2345,6 +2394,33 @@ debug_thread_address_space (struct target_ops *self, ptid_t arg1)
   return result;
 }
 
+static int
+delegate_filesystem_is_local (struct target_ops *self)
+{
+  self = self->beneath;
+  return self->to_filesystem_is_local (self);
+}
+
+static int
+tdefault_filesystem_is_local (struct target_ops *self)
+{
+  return 1;
+}
+
+static int
+debug_filesystem_is_local (struct target_ops *self)
+{
+  int result;
+  fprintf_unfiltered (gdb_stdlog, "-> %s->to_filesystem_is_local (...)\n", debug_target.to_shortname);
+  result = debug_target.to_filesystem_is_local (&debug_target);
+  fprintf_unfiltered (gdb_stdlog, "<- %s->to_filesystem_is_local (", debug_target.to_shortname);
+  target_debug_print_struct_target_ops_p (&debug_target);
+  fputs_unfiltered (") = ", gdb_stdlog);
+  target_debug_print_int (result);
+  fputs_unfiltered ("\n", gdb_stdlog);
+  return result;
+}
+
 static void
 delegate_trace_init (struct target_ops *self)
 {
@@ -3805,29 +3881,6 @@ debug_get_tailcall_unwinder (struct target_ops *self)
   return result;
 }
 
-static CORE_ADDR
-delegate_decr_pc_after_break (struct target_ops *self, struct gdbarch *arg1)
-{
-  self = self->beneath;
-  return self->to_decr_pc_after_break (self, arg1);
-}
-
-static CORE_ADDR
-debug_decr_pc_after_break (struct target_ops *self, struct gdbarch *arg1)
-{
-  CORE_ADDR result;
-  fprintf_unfiltered (gdb_stdlog, "-> %s->to_decr_pc_after_break (...)\n", debug_target.to_shortname);
-  result = debug_target.to_decr_pc_after_break (&debug_target, arg1);
-  fprintf_unfiltered (gdb_stdlog, "<- %s->to_decr_pc_after_break (", debug_target.to_shortname);
-  target_debug_print_struct_target_ops_p (&debug_target);
-  fputs_unfiltered (", ", gdb_stdlog);
-  target_debug_print_struct_gdbarch_p (arg1);
-  fputs_unfiltered (") = ", gdb_stdlog);
-  target_debug_print_CORE_ADDR (result);
-  fputs_unfiltered ("\n", gdb_stdlog);
-  return result;
-}
-
 static void
 delegate_prepare_to_generate_core (struct target_ops *self)
 {
@@ -3987,6 +4040,8 @@ install_delegators (struct target_ops *ops)
     ops->to_thread_name = delegate_thread_name;
   if (ops->to_stop == NULL)
     ops->to_stop = delegate_stop;
+  if (ops->to_interrupt == NULL)
+    ops->to_interrupt = delegate_interrupt;
   if (ops->to_rcmd == NULL)
     ops->to_rcmd = delegate_rcmd;
   if (ops->to_pid_to_exec_file == NULL)
@@ -4003,6 +4058,8 @@ install_delegators (struct target_ops *ops)
     ops->to_async = delegate_async;
   if (ops->to_supports_non_stop == NULL)
     ops->to_supports_non_stop = delegate_supports_non_stop;
+  if (ops->to_always_non_stop_p == NULL)
+    ops->to_always_non_stop_p = delegate_always_non_stop_p;
   if (ops->to_find_memory_regions == NULL)
     ops->to_find_memory_regions = delegate_find_memory_regions;
   if (ops->to_make_corefile_notes == NULL)
@@ -4047,6 +4104,8 @@ install_delegators (struct target_ops *ops)
     ops->to_thread_architecture = delegate_thread_architecture;
   if (ops->to_thread_address_space == NULL)
     ops->to_thread_address_space = delegate_thread_address_space;
+  if (ops->to_filesystem_is_local == NULL)
+    ops->to_filesystem_is_local = delegate_filesystem_is_local;
   if (ops->to_trace_init == NULL)
     ops->to_trace_init = delegate_trace_init;
   if (ops->to_download_tracepoint == NULL)
@@ -4155,8 +4214,6 @@ install_delegators (struct target_ops *ops)
     ops->to_get_unwinder = delegate_get_unwinder;
   if (ops->to_get_tailcall_unwinder == NULL)
     ops->to_get_tailcall_unwinder = delegate_get_tailcall_unwinder;
-  if (ops->to_decr_pc_after_break == NULL)
-    ops->to_decr_pc_after_break = delegate_decr_pc_after_break;
   if (ops->to_prepare_to_generate_core == NULL)
     ops->to_prepare_to_generate_core = delegate_prepare_to_generate_core;
   if (ops->to_done_generating_core == NULL)
@@ -4222,6 +4279,7 @@ install_dummy_methods (struct target_ops *ops)
   ops->to_extra_thread_info = tdefault_extra_thread_info;
   ops->to_thread_name = tdefault_thread_name;
   ops->to_stop = tdefault_stop;
+  ops->to_interrupt = tdefault_interrupt;
   ops->to_rcmd = default_rcmd;
   ops->to_pid_to_exec_file = tdefault_pid_to_exec_file;
   ops->to_log_command = tdefault_log_command;
@@ -4230,6 +4288,7 @@ install_dummy_methods (struct target_ops *ops)
   ops->to_is_async_p = tdefault_is_async_p;
   ops->to_async = tdefault_async;
   ops->to_supports_non_stop = tdefault_supports_non_stop;
+  ops->to_always_non_stop_p = tdefault_always_non_stop_p;
   ops->to_find_memory_regions = dummy_find_memory_regions;
   ops->to_make_corefile_notes = dummy_make_corefile_notes;
   ops->to_get_bookmark = tdefault_get_bookmark;
@@ -4252,6 +4311,7 @@ install_dummy_methods (struct target_ops *ops)
   ops->to_can_run_breakpoint_commands = tdefault_can_run_breakpoint_commands;
   ops->to_thread_architecture = default_thread_architecture;
   ops->to_thread_address_space = default_thread_address_space;
+  ops->to_filesystem_is_local = tdefault_filesystem_is_local;
   ops->to_trace_init = tdefault_trace_init;
   ops->to_download_tracepoint = tdefault_download_tracepoint;
   ops->to_can_download_tracepoint = tdefault_can_download_tracepoint;
@@ -4306,7 +4366,6 @@ install_dummy_methods (struct target_ops *ops)
   ops->to_augmented_libraries_svr4_read = tdefault_augmented_libraries_svr4_read;
   ops->to_get_unwinder = tdefault_get_unwinder;
   ops->to_get_tailcall_unwinder = tdefault_get_tailcall_unwinder;
-  ops->to_decr_pc_after_break = default_target_decr_pc_after_break;
   ops->to_prepare_to_generate_core = tdefault_prepare_to_generate_core;
   ops->to_done_generating_core = tdefault_done_generating_core;
 }
@@ -4370,6 +4429,7 @@ init_debug_target (struct target_ops *ops)
   ops->to_extra_thread_info = debug_extra_thread_info;
   ops->to_thread_name = debug_thread_name;
   ops->to_stop = debug_stop;
+  ops->to_interrupt = debug_interrupt;
   ops->to_rcmd = debug_rcmd;
   ops->to_pid_to_exec_file = debug_pid_to_exec_file;
   ops->to_log_command = debug_log_command;
@@ -4378,6 +4438,7 @@ init_debug_target (struct target_ops *ops)
   ops->to_is_async_p = debug_is_async_p;
   ops->to_async = debug_async;
   ops->to_supports_non_stop = debug_supports_non_stop;
+  ops->to_always_non_stop_p = debug_always_non_stop_p;
   ops->to_find_memory_regions = debug_find_memory_regions;
   ops->to_make_corefile_notes = debug_make_corefile_notes;
   ops->to_get_bookmark = debug_get_bookmark;
@@ -4400,6 +4461,7 @@ init_debug_target (struct target_ops *ops)
   ops->to_can_run_breakpoint_commands = debug_can_run_breakpoint_commands;
   ops->to_thread_architecture = debug_thread_architecture;
   ops->to_thread_address_space = debug_thread_address_space;
+  ops->to_filesystem_is_local = debug_filesystem_is_local;
   ops->to_trace_init = debug_trace_init;
   ops->to_download_tracepoint = debug_download_tracepoint;
   ops->to_can_download_tracepoint = debug_can_download_tracepoint;
@@ -4454,7 +4516,6 @@ init_debug_target (struct target_ops *ops)
   ops->to_augmented_libraries_svr4_read = debug_augmented_libraries_svr4_read;
   ops->to_get_unwinder = debug_get_unwinder;
   ops->to_get_tailcall_unwinder = debug_get_tailcall_unwinder;
-  ops->to_decr_pc_after_break = debug_decr_pc_after_break;
   ops->to_prepare_to_generate_core = debug_prepare_to_generate_core;
   ops->to_done_generating_core = debug_done_generating_core;
 }