convert to_thread_architecture
authorTom Tromey <tromey@redhat.com>
Wed, 18 Dec 2013 18:16:31 +0000 (11:16 -0700)
committerTom Tromey <tromey@redhat.com>
Wed, 19 Feb 2014 14:47:37 +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_thread_architecture.
* target.h (struct target_ops) <to_thread_architecture>: Use
TARGET_DEFAULT_FUNC.

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

index ae8bfacbf1f331f4d078373b514372cdc5731bb2..bd2ec73501e8f4710b5146f605b789501055daf1 100644 (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_thread_architecture.
+       * target.h (struct target_ops) <to_thread_architecture>: Use
+       TARGET_DEFAULT_FUNC.
+
 2014-02-19  Tom Tromey  <tromey@redhat.com>
 
        * target-delegates.c: Rebuild.
index 75a715f9ae97c0199610748091cf3782e480dc45..643b732f239f099a0b1197e87229fafb887482eb 100644 (file)
@@ -584,6 +584,13 @@ delegate_execution_direction (struct target_ops *self)
   return self->to_execution_direction (self);
 }
 
+static struct gdbarch *
+delegate_thread_architecture (struct target_ops *self, ptid_t arg1)
+{
+  self = self->beneath;
+  return self->to_thread_architecture (self, arg1);
+}
+
 static int
 delegate_supports_btrace (struct target_ops *self)
 {
@@ -702,6 +709,8 @@ install_delegators (struct target_ops *ops)
     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_thread_architecture == NULL)
+    ops->to_thread_architecture = delegate_thread_architecture;
   if (ops->to_supports_btrace == NULL)
     ops->to_supports_btrace = delegate_supports_btrace;
 }
@@ -760,5 +769,6 @@ install_dummy_methods (struct target_ops *ops)
   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_thread_architecture = default_thread_architecture;
   ops->to_supports_btrace = tdefault_supports_btrace;
 }
index 7fe28e3a8711b068c41bef6c2f8dc6b0064448d4..6361104e9d1c9d22d3b97bfa154d78927b791a55 100644 (file)
@@ -678,7 +678,7 @@ update_current_target (void)
       /* Do not inherit to_get_thread_local_address.  */
       /* Do not inherit to_can_execute_reverse.  */
       /* Do not inherit to_execution_direction.  */
-      INHERIT (to_thread_architecture, t);
+      /* Do not inherit to_thread_architecture.  */
       /* Do not inherit to_read_description.  */
       INHERIT (to_get_ada_task_ptid, t);
       /* Do not inherit to_search_memory.  */
@@ -748,8 +748,6 @@ update_current_target (void)
   de_fault (to_stop,
            (void (*) (struct target_ops *, ptid_t))
            target_ignore);
-  de_fault (to_thread_architecture,
-           default_thread_architecture);
   current_target.to_read_description = NULL;
   de_fault (to_get_ada_task_ptid,
             (ptid_t (*) (struct target_ops *, long, long))
index fa6056ed7c73cac98b7f77826d9164e3f603b63d..733fdfe3641640c098c25adae5223f826a3e23f7 100644 (file)
@@ -742,7 +742,8 @@ struct target_ops
        ptrace operations need to operate according to target_gdbarch ().
 
        The default implementation always returns target_gdbarch ().  */
-    struct gdbarch *(*to_thread_architecture) (struct target_ops *, ptid_t);
+    struct gdbarch *(*to_thread_architecture) (struct target_ops *, ptid_t)
+      TARGET_DEFAULT_FUNC (default_thread_architecture);
 
     /* Determine current address space of thread PTID.