From fe31bf5b9e1b6fcfc5f083228328a84b6af19ad8 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 18 Dec 2013 11:15:21 -0700 Subject: [PATCH] convert to_execution_direction 2014-02-19 Tom Tromey * target-delegates.c: Rebuild. * target.c (update_current_target): Don't inherit or default to_execution_direction. * target.h (struct target_ops) : Use TARGET_DEFAULT_FUNC. --- gdb/ChangeLog | 8 ++++++++ gdb/target-delegates.c | 10 ++++++++++ gdb/target.c | 6 ++++-- gdb/target.h | 3 ++- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 48940193a8a..ae8bfacbf1f 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_execution_direction. + * target.h (struct target_ops) : Use + TARGET_DEFAULT_FUNC. + 2014-02-19 Tom Tromey * target-delegates.c: Rebuild. diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c index 573f9b5f92c..75a715f9ae9 100644 --- a/gdb/target-delegates.c +++ b/gdb/target-delegates.c @@ -577,6 +577,13 @@ tdefault_can_execute_reverse (struct target_ops *self) return 0; } +static enum exec_direction_kind +delegate_execution_direction (struct target_ops *self) +{ + self = self->beneath; + return self->to_execution_direction (self); +} + static int delegate_supports_btrace (struct target_ops *self) { @@ -693,6 +700,8 @@ install_delegators (struct target_ops *ops) ops->to_xfer_partial = delegate_xfer_partial; if (ops->to_can_execute_reverse == NULL) ops->to_can_execute_reverse = delegate_can_execute_reverse; + if (ops->to_execution_direction == NULL) + ops->to_execution_direction = delegate_execution_direction; if (ops->to_supports_btrace == NULL) ops->to_supports_btrace = delegate_supports_btrace; } @@ -750,5 +759,6 @@ install_dummy_methods (struct target_ops *ops) ops->to_goto_bookmark = tdefault_goto_bookmark; ops->to_xfer_partial = tdefault_xfer_partial; ops->to_can_execute_reverse = tdefault_can_execute_reverse; + ops->to_execution_direction = default_execution_direction; ops->to_supports_btrace = tdefault_supports_btrace; } diff --git a/gdb/target.c b/gdb/target.c index 1f60aa0f4d2..7fe28e3a871 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -89,6 +89,9 @@ static int find_default_can_async_p (struct target_ops *ignore); static int find_default_is_async_p (struct target_ops *ignore); +static enum exec_direction_kind default_execution_direction + (struct target_ops *self); + #include "target-delegates.c" static void init_dummy_target (void); @@ -674,7 +677,7 @@ update_current_target (void) /* Do not inherit to_goto_bookmark. */ /* Do not inherit to_get_thread_local_address. */ /* Do not inherit to_can_execute_reverse. */ - INHERIT (to_execution_direction, t); + /* Do not inherit to_execution_direction. */ INHERIT (to_thread_architecture, t); /* Do not inherit to_read_description. */ INHERIT (to_get_ada_task_ptid, t); @@ -861,7 +864,6 @@ update_current_target (void) de_fault (to_augmented_libraries_svr4_read, (int (*) (struct target_ops *)) return_zero); - de_fault (to_execution_direction, default_execution_direction); #undef de_fault diff --git a/gdb/target.h b/gdb/target.h index 9b0ad98f211..fa6056ed7c7 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -707,7 +707,8 @@ struct target_ops /* The direction the target is currently executing. Must be implemented on targets that support reverse execution and async mode. The default simply returns forward execution. */ - enum exec_direction_kind (*to_execution_direction) (struct target_ops *); + enum exec_direction_kind (*to_execution_direction) (struct target_ops *) + TARGET_DEFAULT_FUNC (default_execution_direction); /* Does this target support debugging multiple processes simultaneously? */ -- 2.30.2