From 719acc4a29542c9f9f24cbf57b1627cbc61b14fe Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 18 Dec 2013 14:00:23 -0700 Subject: [PATCH] convert to_can_download_tracepoint 2014-02-19 Tom Tromey * target-delegates.c: Rebuild. * target.c (update_current_target): Don't inherit or default to_can_download_tracepoint. * target.h (struct target_ops) : Use TARGET_DEFAULT_RETURN. --- gdb/ChangeLog | 8 ++++++++ gdb/target-delegates.c | 16 ++++++++++++++++ gdb/target.c | 5 +---- gdb/target.h | 3 ++- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 51df9f99063..4a5c9ea7853 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2014-02-19 Tom Tromey + + * target-delegates.c: Rebuild. + * target.c (update_current_target): Don't inherit or default + to_can_download_tracepoint. + * target.h (struct target_ops) : Use + TARGET_DEFAULT_RETURN. + 2014-02-19 Tom Tromey * target-delegates.c: Rebuild. diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c index 560a099b08c..2e0fddb0c67 100644 --- a/gdb/target-delegates.c +++ b/gdb/target-delegates.c @@ -663,6 +663,19 @@ tdefault_download_tracepoint (struct target_ops *self, struct bp_location *arg1) tcomplain (); } +static int +delegate_can_download_tracepoint (struct target_ops *self) +{ + self = self->beneath; + return self->to_can_download_tracepoint (self); +} + +static int +tdefault_can_download_tracepoint (struct target_ops *self) +{ + return 0; +} + static int delegate_supports_btrace (struct target_ops *self) { @@ -795,6 +808,8 @@ install_delegators (struct target_ops *ops) ops->to_trace_init = delegate_trace_init; if (ops->to_download_tracepoint == NULL) ops->to_download_tracepoint = delegate_download_tracepoint; + if (ops->to_can_download_tracepoint == NULL) + ops->to_can_download_tracepoint = delegate_can_download_tracepoint; if (ops->to_supports_btrace == NULL) ops->to_supports_btrace = delegate_supports_btrace; } @@ -860,5 +875,6 @@ install_dummy_methods (struct target_ops *ops) ops->to_thread_architecture = default_thread_architecture; ops->to_trace_init = tdefault_trace_init; ops->to_download_tracepoint = tdefault_download_tracepoint; + ops->to_can_download_tracepoint = tdefault_can_download_tracepoint; ops->to_supports_btrace = tdefault_supports_btrace; } diff --git a/gdb/target.c b/gdb/target.c index 1865e69f5b1..ce81c7cf120 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -690,7 +690,7 @@ update_current_target (void) /* Do not inherit to_supports_string_tracing. */ /* Do not inherit to_trace_init. */ /* Do not inherit to_download_tracepoint. */ - INHERIT (to_can_download_tracepoint, t); + /* Do not inherit to_can_download_tracepoint. */ INHERIT (to_download_trace_state_variable, t); INHERIT (to_enable_tracepoint, t); INHERIT (to_disable_tracepoint, 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_can_download_tracepoint, - (int (*) (struct target_ops *)) - return_zero); de_fault (to_download_trace_state_variable, (void (*) (struct target_ops *, struct trace_state_variable *)) tcomplain); diff --git a/gdb/target.h b/gdb/target.h index 3cfdfab19dd..f0b46e4c460 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -811,7 +811,8 @@ struct target_ops /* Is the target able to download tracepoint locations in current state? */ - int (*to_can_download_tracepoint) (struct target_ops *); + int (*to_can_download_tracepoint) (struct target_ops *) + TARGET_DEFAULT_RETURN (0); /* Send full details of a trace state variable to the target. */ void (*to_download_trace_state_variable) (struct target_ops *, -- 2.30.2