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

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

index 82e4973..44b1a96 100644 (file)
@@ -2,6 +2,14 @@
 
        * target-delegates.c: Rebuild.
        * target.c (update_current_target): Don't inherit or default
+       to_get_trace_state_variable_value.
+       * target.h (struct target_ops)
+       <to_get_trace_state_variable_value>: 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_find.
        * target.h (struct target_ops): Use TARGET_DEFAULT_RETURN.
 
index 2fd51e2..4c934e7 100644 (file)
@@ -794,6 +794,19 @@ tdefault_trace_find (struct target_ops *self, enum trace_find_type  arg1, int ar
 }
 
 static int
+delegate_get_trace_state_variable_value (struct target_ops *self, int arg1, LONGEST *arg2)
+{
+  self = self->beneath;
+  return self->to_get_trace_state_variable_value (self, arg1, arg2);
+}
+
+static int
+tdefault_get_trace_state_variable_value (struct target_ops *self, int arg1, LONGEST *arg2)
+{
+  return 0;
+}
+
+static int
 delegate_supports_btrace (struct target_ops *self)
 {
   self = self->beneath;
@@ -945,6 +958,8 @@ install_delegators (struct target_ops *ops)
     ops->to_trace_stop = delegate_trace_stop;
   if (ops->to_trace_find == NULL)
     ops->to_trace_find = delegate_trace_find;
+  if (ops->to_get_trace_state_variable_value == NULL)
+    ops->to_get_trace_state_variable_value = delegate_get_trace_state_variable_value;
   if (ops->to_supports_btrace == NULL)
     ops->to_supports_btrace = delegate_supports_btrace;
 }
@@ -1020,5 +1035,6 @@ install_dummy_methods (struct target_ops *ops)
   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_get_trace_state_variable_value = tdefault_get_trace_state_variable_value;
   ops->to_supports_btrace = tdefault_supports_btrace;
 }
index 9ef0762..f0309f1 100644 (file)
@@ -700,7 +700,7 @@ update_current_target (void)
       /* Do not inherit to_get_tracepoint_status.  */
       /* Do not inherit to_trace_stop.  */
       /* Do not inherit to_trace_find.  */
-      INHERIT (to_get_trace_state_variable_value, t);
+      /* Do not inherit to_get_trace_state_variable_value.  */
       INHERIT (to_save_trace_data, t);
       INHERIT (to_upload_tracepoints, t);
       INHERIT (to_upload_trace_state_variables, 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_get_trace_state_variable_value,
-           (int (*) (struct target_ops *, int, LONGEST *))
-           return_zero);
   de_fault (to_save_trace_data,
            (int (*) (struct target_ops *, const char *))
            tcomplain);
index f85ec56..4331b91 100644 (file)
@@ -866,7 +866,8 @@ struct target_ops
        1 if the value is known and writing the value itself into the
        location pointed to by VAL, else returning 0.  */
     int (*to_get_trace_state_variable_value) (struct target_ops *,
-                                             int tsv, LONGEST *val);
+                                             int tsv, LONGEST *val)
+      TARGET_DEFAULT_RETURN (0);
 
     int (*to_save_trace_data) (struct target_ops *, const char *filename);