convert to_trace_find
authorTom Tromey <tromey@redhat.com>
Wed, 18 Dec 2013 21:08:14 +0000 (14:08 -0700)
committerTom Tromey <tromey@redhat.com>
Wed, 19 Feb 2014 14:47:51 +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_trace_find.
* target.h (struct target_ops): Use TARGET_DEFAULT_RETURN.

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

index a8c76c8..82e4973 100644 (file)
@@ -2,6 +2,13 @@
 
        * target-delegates.c: Rebuild.
        * target.c (update_current_target): Don't inherit or default
+       to_trace_find.
+       * target.h (struct target_ops): Use TARGET_DEFAULT_RETURN.
+
+2014-02-19  Tom Tromey  <tromey@redhat.com>
+
+       * target-delegates.c: Rebuild.
+       * target.c (update_current_target): Don't inherit or default
        to_trace_stop.
        * target.h (struct target_ops) <to_trace_stop>: Use
        TARGET_DEFAULT_NORETURN.
index 62fda4c..2fd51e2 100644 (file)
@@ -781,6 +781,19 @@ tdefault_trace_stop (struct target_ops *self)
 }
 
 static int
+delegate_trace_find (struct target_ops *self, enum trace_find_type  arg1, int arg2, CORE_ADDR arg3, CORE_ADDR arg4, int *arg5)
+{
+  self = self->beneath;
+  return self->to_trace_find (self, arg1, arg2, arg3, arg4, arg5);
+}
+
+static int
+tdefault_trace_find (struct target_ops *self, enum trace_find_type  arg1, int arg2, CORE_ADDR arg3, CORE_ADDR arg4, int *arg5)
+{
+  return -1;
+}
+
+static int
 delegate_supports_btrace (struct target_ops *self)
 {
   self = self->beneath;
@@ -930,6 +943,8 @@ install_delegators (struct target_ops *ops)
     ops->to_get_tracepoint_status = delegate_get_tracepoint_status;
   if (ops->to_trace_stop == NULL)
     ops->to_trace_stop = delegate_trace_stop;
+  if (ops->to_trace_find == NULL)
+    ops->to_trace_find = delegate_trace_find;
   if (ops->to_supports_btrace == NULL)
     ops->to_supports_btrace = delegate_supports_btrace;
 }
@@ -1004,5 +1019,6 @@ install_dummy_methods (struct target_ops *ops)
   ops->to_get_trace_status = tdefault_get_trace_status;
   ops->to_get_tracepoint_status = tdefault_get_tracepoint_status;
   ops->to_trace_stop = tdefault_trace_stop;
+  ops->to_trace_find = tdefault_trace_find;
   ops->to_supports_btrace = tdefault_supports_btrace;
 }
index 02981e2..9ef0762 100644 (file)
@@ -699,7 +699,7 @@ update_current_target (void)
       /* Do not inherit to_get_trace_status.  */
       /* Do not inherit to_get_tracepoint_status.  */
       /* Do not inherit to_trace_stop.  */
-      INHERIT (to_trace_find, t);
+      /* Do not inherit to_trace_find.  */
       INHERIT (to_get_trace_state_variable_value, t);
       INHERIT (to_save_trace_data, t);
       INHERIT (to_upload_tracepoints, t);
@@ -752,10 +752,6 @@ update_current_target (void)
            (void (*) (struct target_ops *, ptid_t))
            target_ignore);
   current_target.to_read_description = NULL;
-  de_fault (to_trace_find,
-           (int (*) (struct target_ops *,
-                     enum trace_find_type, int, CORE_ADDR, CORE_ADDR, int *))
-           return_minus_one);
   de_fault (to_get_trace_state_variable_value,
            (int (*) (struct target_ops *, int, LONGEST *))
            return_zero);
index ad644a5..f85ec56 100644 (file)
@@ -859,7 +859,8 @@ struct target_ops
       operation fails.  */
     int (*to_trace_find) (struct target_ops *,
                          enum trace_find_type type, int num,
-                         CORE_ADDR addr1, CORE_ADDR addr2, int *tpp);
+                         CORE_ADDR addr1, CORE_ADDR addr2, int *tpp)
+      TARGET_DEFAULT_RETURN (-1);
 
     /* Get the value of the trace state variable number TSV, returning
        1 if the value is known and writing the value itself into the