From aab1b22d31545efe8dfdd942e2050b3be0c9cf2e Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 18 Dec 2013 13:54:59 -0700 Subject: [PATCH] convert to_supports_enable_disable_tracepoint 2014-02-19 Tom Tromey * target-delegates.c: Rebuild. * target.c (update_current_target): Don't inherit or default to_supports_enable_disable_tracepoint. * target.h (struct target_ops) : Use TARGET_DEFAULT_RETURN. --- gdb/ChangeLog | 9 +++++++++ gdb/target-delegates.c | 16 ++++++++++++++++ gdb/target.c | 5 +---- gdb/target.h | 3 ++- 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 73ffdf89dfd..13f4a7d4525 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2014-02-19 Tom Tromey + + * target-delegates.c: Rebuild. + * target.c (update_current_target): Don't inherit or default + to_supports_enable_disable_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 3a322c11fe8..30bea1c1b8c 100644 --- a/gdb/target-delegates.c +++ b/gdb/target-delegates.c @@ -604,6 +604,19 @@ tdefault_supports_multi_process (struct target_ops *self) return 0; } +static int +delegate_supports_enable_disable_tracepoint (struct target_ops *self) +{ + self = self->beneath; + return self->to_supports_enable_disable_tracepoint (self); +} + +static int +tdefault_supports_enable_disable_tracepoint (struct target_ops *self) +{ + return 0; +} + static struct gdbarch * delegate_thread_architecture (struct target_ops *self, ptid_t arg1) { @@ -733,6 +746,8 @@ install_delegators (struct target_ops *ops) ops->to_execution_direction = delegate_execution_direction; if (ops->to_supports_multi_process == NULL) ops->to_supports_multi_process = delegate_supports_multi_process; + if (ops->to_supports_enable_disable_tracepoint == NULL) + ops->to_supports_enable_disable_tracepoint = delegate_supports_enable_disable_tracepoint; if (ops->to_thread_architecture == NULL) ops->to_thread_architecture = delegate_thread_architecture; if (ops->to_supports_btrace == NULL) @@ -795,6 +810,7 @@ install_dummy_methods (struct target_ops *ops) ops->to_can_execute_reverse = tdefault_can_execute_reverse; ops->to_execution_direction = default_execution_direction; ops->to_supports_multi_process = tdefault_supports_multi_process; + ops->to_supports_enable_disable_tracepoint = tdefault_supports_enable_disable_tracepoint; ops->to_thread_architecture = default_thread_architecture; ops->to_supports_btrace = tdefault_supports_btrace; } diff --git a/gdb/target.c b/gdb/target.c index bfa36350f2a..7d96806fa71 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -686,7 +686,7 @@ update_current_target (void) /* Do not inherit to_get_ada_task_ptid. */ /* Do not inherit to_search_memory. */ /* Do not inherit to_supports_multi_process. */ - INHERIT (to_supports_enable_disable_tracepoint, t); + /* Do not inherit to_supports_enable_disable_tracepoint. */ INHERIT (to_supports_string_tracing, t); INHERIT (to_trace_init, t); INHERIT (to_download_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_supports_enable_disable_tracepoint, - (int (*) (struct target_ops *)) - return_zero); de_fault (to_supports_string_tracing, (int (*) (struct target_ops *)) return_zero); diff --git a/gdb/target.h b/gdb/target.h index 390201d598c..5fb7defe89d 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -718,7 +718,8 @@ struct target_ops /* Does this target support enabling and disabling tracepoints while a trace experiment is running? */ - int (*to_supports_enable_disable_tracepoint) (struct target_ops *); + int (*to_supports_enable_disable_tracepoint) (struct target_ops *) + TARGET_DEFAULT_RETURN (0); /* Does this target support disabling address space randomization? */ int (*to_supports_disable_randomization) (struct target_ops *); -- 2.30.2