convert to_execution_direction

2014-02-19  Tom Tromey  <tromey@redhat.com>

	* target-delegates.c: Rebuild.
	* target.c (update_current_target): Don't inherit or default
	to_execution_direction.
	* target.h (struct target_ops) <to_execution_direction>: Use
	TARGET_DEFAULT_FUNC.
This commit is contained in:
Tom Tromey 2013-12-18 11:15:21 -07:00
parent 53e1cfc77f
commit fe31bf5b9e
4 changed files with 24 additions and 3 deletions

View File

@ -1,3 +1,11 @@
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_execution_direction.
* target.h (struct target_ops) <to_execution_direction>: Use
TARGET_DEFAULT_FUNC.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.

View File

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

View File

@ -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

View File

@ -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? */