+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.
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)
{
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;
}
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;
}
static int return_zero (void);
-static int return_minus_one (void);
-
static void *return_null (void);
void target_ignore (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);
(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);
return 0;
}
-static int
-return_minus_one (void)
-{
- return -1;
-}
-
static void *
return_null (void)
{
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. */