convert to_upload_tracepoints
authorTom Tromey <tromey@redhat.com>
Wed, 18 Dec 2013 21:10:14 +0000 (14:10 -0700)
committerTom Tromey <tromey@redhat.com>
Wed, 19 Feb 2014 14:47:53 +0000 (07:47 -0700)
2014-02-19  Tom Tromey  <tromey@redhat.com>

* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_upload_tracepoints.
* target.h (struct target_ops) <to_upload_tracepoints>: Use
TARGET_DEFAULT_RETURN.

gdb/ChangeLog
gdb/target-delegates.c
gdb/target.c
gdb/target.h

index 987d8b2d9e3b289e5e8ebdfc7dd064401d6dbb5d..7275f1b2e4bbc6f020405403474b78bef208cc32 100644 (file)
@@ -1,3 +1,11 @@
+2014-02-19  Tom Tromey  <tromey@redhat.com>
+
+       * target-delegates.c: Rebuild.
+       * target.c (update_current_target): Don't inherit or default
+       to_upload_tracepoints.
+       * target.h (struct target_ops) <to_upload_tracepoints>: Use
+       TARGET_DEFAULT_RETURN.
+
 2014-02-19  Tom Tromey  <tromey@redhat.com>
 
        * target-delegates.c: Rebuild.
index a1844d8ccfedf64f7e9285c4f9a03e8543dc5b15..87feef0fd2997ca51d49276d2e3d8cd6dc42ea72 100644 (file)
@@ -819,6 +819,19 @@ tdefault_save_trace_data (struct target_ops *self, const char *arg1)
   tcomplain ();
 }
 
+static int
+delegate_upload_tracepoints (struct target_ops *self, struct uploaded_tp **arg1)
+{
+  self = self->beneath;
+  return self->to_upload_tracepoints (self, arg1);
+}
+
+static int
+tdefault_upload_tracepoints (struct target_ops *self, struct uploaded_tp **arg1)
+{
+  return 0;
+}
+
 static int
 delegate_supports_btrace (struct target_ops *self)
 {
@@ -975,6 +988,8 @@ install_delegators (struct target_ops *ops)
     ops->to_get_trace_state_variable_value = delegate_get_trace_state_variable_value;
   if (ops->to_save_trace_data == NULL)
     ops->to_save_trace_data = delegate_save_trace_data;
+  if (ops->to_upload_tracepoints == NULL)
+    ops->to_upload_tracepoints = delegate_upload_tracepoints;
   if (ops->to_supports_btrace == NULL)
     ops->to_supports_btrace = delegate_supports_btrace;
 }
@@ -1052,5 +1067,6 @@ install_dummy_methods (struct target_ops *ops)
   ops->to_trace_find = tdefault_trace_find;
   ops->to_get_trace_state_variable_value = tdefault_get_trace_state_variable_value;
   ops->to_save_trace_data = tdefault_save_trace_data;
+  ops->to_upload_tracepoints = tdefault_upload_tracepoints;
   ops->to_supports_btrace = tdefault_supports_btrace;
 }
index 44900ed995d66d3e206673ef2479c24dc5cfb831..e4061427249a53f4d73de56112a0d9091ed000ee 100644 (file)
@@ -702,7 +702,7 @@ update_current_target (void)
       /* Do not inherit to_trace_find.  */
       /* Do not inherit to_get_trace_state_variable_value.  */
       /* Do not inherit to_save_trace_data.  */
-      INHERIT (to_upload_tracepoints, t);
+      /* Do not inherit to_upload_tracepoints.  */
       INHERIT (to_upload_trace_state_variables, t);
       INHERIT (to_get_raw_trace_data, t);
       INHERIT (to_get_min_fast_tracepoint_insn_len, t);
@@ -752,9 +752,6 @@ update_current_target (void)
            (void (*) (struct target_ops *, ptid_t))
            target_ignore);
   current_target.to_read_description = NULL;
-  de_fault (to_upload_tracepoints,
-           (int (*) (struct target_ops *, struct uploaded_tp **))
-           return_zero);
   de_fault (to_upload_trace_state_variables,
            (int (*) (struct target_ops *, struct uploaded_tsv **))
            return_zero);
index 9a7f3e4ae68118543c1c83c8f710cf4670346be8..f1e08a4cf365f0062504a422e77fc06508b4f917 100644 (file)
@@ -873,7 +873,8 @@ struct target_ops
       TARGET_DEFAULT_NORETURN (tcomplain ());
 
     int (*to_upload_tracepoints) (struct target_ops *,
-                                 struct uploaded_tp **utpp);
+                                 struct uploaded_tp **utpp)
+      TARGET_DEFAULT_RETURN (0);
 
     int (*to_upload_trace_state_variables) (struct target_ops *,
                                            struct uploaded_tsv **utsvp);