convert to_get_min_fast_tracepoint_insn_len
authorTom Tromey <tromey@redhat.com>
Wed, 18 Dec 2013 21:11:53 +0000 (14:11 -0700)
committerTom Tromey <tromey@redhat.com>
Wed, 19 Feb 2014 14:47:55 +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_min_fast_tracepoint_insn_len.
(return_minus_one): Remove.
* target.h (struct target_ops)
<to_get_min_fast_tracepoint_insn_len>: Use TARGET_DEFAULT_RETURN.

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

index d560ad6419b113cf4ebde1038f0300e3b1eee101..57dfaf26b84f2e6ce93fd181ae3c4fdcd52e24ff 100644 (file)
@@ -1,3 +1,12 @@
+2014-02-19  Tom Tromey  <tromey@redhat.com>
+
+       * target-delegates.c: Rebuild.
+       * target.c (update_current_target): Don't inherit or default
+       to_get_min_fast_tracepoint_insn_len.
+       (return_minus_one): Remove.
+       * target.h (struct target_ops)
+       <to_get_min_fast_tracepoint_insn_len>: Use TARGET_DEFAULT_RETURN.
+
 2014-02-19  Tom Tromey  <tromey@redhat.com>
 
        * target-delegates.c: Rebuild.
index cdf29053d041a44491d8ef5468836ee8798c0b0a..ae9e5672231ede3ab4154382586e55cac0321f2d 100644 (file)
@@ -858,6 +858,19 @@ tdefault_get_raw_trace_data (struct target_ops *self, gdb_byte *arg1, ULONGEST a
   tcomplain ();
 }
 
+static int
+delegate_get_min_fast_tracepoint_insn_len (struct target_ops *self)
+{
+  self = self->beneath;
+  return self->to_get_min_fast_tracepoint_insn_len (self);
+}
+
+static int
+tdefault_get_min_fast_tracepoint_insn_len (struct target_ops *self)
+{
+  return -1;
+}
+
 static int
 delegate_supports_btrace (struct target_ops *self)
 {
@@ -1020,6 +1033,8 @@ install_delegators (struct target_ops *ops)
     ops->to_upload_trace_state_variables = delegate_upload_trace_state_variables;
   if (ops->to_get_raw_trace_data == NULL)
     ops->to_get_raw_trace_data = delegate_get_raw_trace_data;
+  if (ops->to_get_min_fast_tracepoint_insn_len == NULL)
+    ops->to_get_min_fast_tracepoint_insn_len = delegate_get_min_fast_tracepoint_insn_len;
   if (ops->to_supports_btrace == NULL)
     ops->to_supports_btrace = delegate_supports_btrace;
 }
@@ -1100,5 +1115,6 @@ install_dummy_methods (struct target_ops *ops)
   ops->to_upload_tracepoints = tdefault_upload_tracepoints;
   ops->to_upload_trace_state_variables = tdefault_upload_trace_state_variables;
   ops->to_get_raw_trace_data = tdefault_get_raw_trace_data;
+  ops->to_get_min_fast_tracepoint_insn_len = tdefault_get_min_fast_tracepoint_insn_len;
   ops->to_supports_btrace = tdefault_supports_btrace;
 }
index 8caa720d5b458de58f050f5870bfcadbc06f7c83..bfbf5fde64ac448c4cc136f5c1d56ebaaee677da 100644 (file)
@@ -66,8 +66,6 @@ static int nomemory (CORE_ADDR, char *, int, int, struct target_ops *);
 
 static int return_zero (void);
 
-static int return_minus_one (void);
-
 static void *return_null (void);
 
 void target_ignore (void);
@@ -705,7 +703,7 @@ update_current_target (void)
       /* Do not inherit to_upload_tracepoints.  */
       /* Do not inherit to_upload_trace_state_variables.  */
       /* Do not inherit to_get_raw_trace_data.  */
-      INHERIT (to_get_min_fast_tracepoint_insn_len, t);
+      /* Do not inherit to_get_min_fast_tracepoint_insn_len.  */
       INHERIT (to_set_disconnected_tracing, t);
       INHERIT (to_set_circular_trace_buffer, t);
       INHERIT (to_set_trace_buffer_size, t);
@@ -752,9 +750,6 @@ update_current_target (void)
            (void (*) (struct target_ops *, ptid_t))
            target_ignore);
   current_target.to_read_description = NULL;
-  de_fault (to_get_min_fast_tracepoint_insn_len,
-           (int (*) (struct target_ops *))
-           return_minus_one);
   de_fault (to_set_disconnected_tracing,
            (void (*) (struct target_ops *, int))
            target_ignore);
@@ -3510,12 +3505,6 @@ return_zero (void)
   return 0;
 }
 
-static int
-return_minus_one (void)
-{
-  return -1;
-}
-
 static void *
 return_null (void)
 {
index 9fe5991809b37a2df24e107e41cf5c98051576cc..3cdb0287ff0c18ca4deef1fbacac0101dc827820 100644 (file)
@@ -888,7 +888,8 @@ struct target_ops
        may be set on the target.  If this operation is unsupported,
        return -1.  If for some reason the minimum length cannot be
        determined, return 0.  */
-    int (*to_get_min_fast_tracepoint_insn_len) (struct target_ops *);
+    int (*to_get_min_fast_tracepoint_insn_len) (struct target_ops *)
+      TARGET_DEFAULT_RETURN (-1);
 
     /* Set the target's tracing behavior in response to unexpected
        disconnection - set VAL to 1 to keep tracing, 0 to stop.  */
This page took 0.033919 seconds and 4 git commands to generate.