convert to_get_min_fast_tracepoint_insn_len

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.
This commit is contained in:
Tom Tromey 2013-12-18 14:11:53 -07:00
parent ace92e7d14
commit 9249843f19
4 changed files with 28 additions and 13 deletions

View 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.

View 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;
}

View 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)
{

View 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. */