convert to_execution_direction
authorTom Tromey <tromey@redhat.com>
Wed, 18 Dec 2013 18:15:21 +0000 (11:15 -0700)
committerTom Tromey <tromey@redhat.com>
Wed, 19 Feb 2014 14:47:36 +0000 (07:47 -0700)
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.

gdb/ChangeLog
gdb/target-delegates.c
gdb/target.c
gdb/target.h

index 4894019..ae8bfac 100644 (file)
@@ -2,6 +2,14 @@
 
        * 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.
+       * target.c (update_current_target): Don't inherit or default
        to_can_execute_reverse.
        * target.h (struct target_ops) <to_can_execute_reverse>: Use
        TARGET_DEFAULT_RETURN.
index 573f9b5..75a715f 100644 (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;
 }
index 1f60aa0..7fe28e3 100644 (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
 
index 9b0ad98..fa6056e 100644 (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?  */