+2014-02-19 Tom Tromey <tromey@redhat.com>
+
+ * target-delegates.c: Rebuild.
+ * target.c (update_current_target): Don't inherit or default
+ to_use_agent.
+ * target.h (struct target_ops) <to_use_agent>: Use
+ TARGET_DEFAULT_NORETURN.
+
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
return 0;
}
+static int
+delegate_use_agent (struct target_ops *self, int arg1)
+{
+ self = self->beneath;
+ return self->to_use_agent (self, arg1);
+}
+
+static int
+tdefault_use_agent (struct target_ops *self, int arg1)
+{
+ tcomplain ();
+}
+
static int
delegate_supports_btrace (struct target_ops *self)
{
ops->to_static_tracepoint_markers_by_strid = delegate_static_tracepoint_markers_by_strid;
if (ops->to_traceframe_info == NULL)
ops->to_traceframe_info = delegate_traceframe_info;
+ if (ops->to_use_agent == NULL)
+ ops->to_use_agent = delegate_use_agent;
if (ops->to_supports_btrace == NULL)
ops->to_supports_btrace = delegate_supports_btrace;
}
ops->to_static_tracepoint_marker_at = tdefault_static_tracepoint_marker_at;
ops->to_static_tracepoint_markers_by_strid = tdefault_static_tracepoint_markers_by_strid;
ops->to_traceframe_info = tdefault_traceframe_info;
+ ops->to_use_agent = tdefault_use_agent;
ops->to_supports_btrace = tdefault_supports_btrace;
}
/* Do not inherit to_static_tracepoint_marker_at. */
/* Do not inherit to_static_tracepoint_markers_by_strid. */
/* Do not inherit to_traceframe_info. */
- INHERIT (to_use_agent, t);
+ /* Do not inherit to_use_agent. */
INHERIT (to_can_use_agent, t);
INHERIT (to_augmented_libraries_svr4_read, t);
INHERIT (to_magic, t);
de_fault (to_can_run_breakpoint_commands,
(int (*) (struct target_ops *))
return_zero);
- de_fault (to_use_agent,
- (int (*) (struct target_ops *, int))
- tcomplain);
de_fault (to_can_use_agent,
(int (*) (struct target_ops *))
return_zero);
/* Ask the target to use or not to use agent according to USE. Return 1
successful, 0 otherwise. */
- int (*to_use_agent) (struct target_ops *, int use);
+ int (*to_use_agent) (struct target_ops *, int use)
+ TARGET_DEFAULT_NORETURN (tcomplain ());
/* Is the target able to use agent in current state? */
int (*to_can_use_agent) (struct target_ops *);