convert to_get_ada_task_ptid
authorTom Tromey <tromey@redhat.com>
Wed, 18 Dec 2013 20:53:09 +0000 (13:53 -0700)
committerTom Tromey <tromey@redhat.com>
Wed, 19 Feb 2014 14:47:38 +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_get_ada_task_ptid.
* target.h (struct target_ops) <to_get_ada_task_ptid>: Use
TARGET_DEFAULT_FUNC.

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

index bd2ec73..fc14e48 100644 (file)
@@ -2,6 +2,14 @@
 
        * target-delegates.c: Rebuild.
        * target.c (update_current_target): Don't inherit or default
+       to_get_ada_task_ptid.
+       * target.h (struct target_ops) <to_get_ada_task_ptid>: 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_thread_architecture.
        * target.h (struct target_ops) <to_thread_architecture>: Use
        TARGET_DEFAULT_FUNC.
index 643b732..f92b096 100644 (file)
@@ -564,6 +564,13 @@ tdefault_xfer_partial (struct target_ops *self, enum target_object  arg1, const
   return TARGET_XFER_E_IO;
 }
 
+static ptid_t
+delegate_get_ada_task_ptid (struct target_ops *self, long arg1, long arg2)
+{
+  self = self->beneath;
+  return self->to_get_ada_task_ptid (self, arg1, arg2);
+}
+
 static int
 delegate_can_execute_reverse (struct target_ops *self)
 {
@@ -705,6 +712,8 @@ install_delegators (struct target_ops *ops)
     ops->to_goto_bookmark = delegate_goto_bookmark;
   if (ops->to_xfer_partial == NULL)
     ops->to_xfer_partial = delegate_xfer_partial;
+  if (ops->to_get_ada_task_ptid == NULL)
+    ops->to_get_ada_task_ptid = delegate_get_ada_task_ptid;
   if (ops->to_can_execute_reverse == NULL)
     ops->to_can_execute_reverse = delegate_can_execute_reverse;
   if (ops->to_execution_direction == NULL)
@@ -767,6 +776,7 @@ install_dummy_methods (struct target_ops *ops)
   ops->to_get_bookmark = tdefault_get_bookmark;
   ops->to_goto_bookmark = tdefault_goto_bookmark;
   ops->to_xfer_partial = tdefault_xfer_partial;
+  ops->to_get_ada_task_ptid = default_get_ada_task_ptid;
   ops->to_can_execute_reverse = tdefault_can_execute_reverse;
   ops->to_execution_direction = default_execution_direction;
   ops->to_thread_architecture = default_thread_architecture;
index 6361104..083d6b5 100644 (file)
@@ -57,6 +57,9 @@ static int default_region_ok_for_hw_watchpoint (struct target_ops *,
 
 static void default_rcmd (struct target_ops *, char *, struct ui_file *);
 
+static ptid_t default_get_ada_task_ptid (struct target_ops *self,
+                                        long lwp, long tid);
+
 static void tcomplain (void) ATTRIBUTE_NORETURN;
 
 static int nomemory (CORE_ADDR, char *, int, int, struct target_ops *);
@@ -680,7 +683,7 @@ update_current_target (void)
       /* Do not inherit to_execution_direction.  */
       /* Do not inherit to_thread_architecture.  */
       /* Do not inherit to_read_description.  */
-      INHERIT (to_get_ada_task_ptid, t);
+      /* Do not inherit to_get_ada_task_ptid.  */
       /* Do not inherit to_search_memory.  */
       INHERIT (to_supports_multi_process, t);
       INHERIT (to_supports_enable_disable_tracepoint, t);
@@ -749,9 +752,6 @@ update_current_target (void)
            (void (*) (struct target_ops *, ptid_t))
            target_ignore);
   current_target.to_read_description = NULL;
-  de_fault (to_get_ada_task_ptid,
-            (ptid_t (*) (struct target_ops *, long, long))
-            default_get_ada_task_ptid);
   de_fault (to_supports_multi_process,
            (int (*) (struct target_ops *))
            return_zero);
index 733fdfe..fc90a8b 100644 (file)
@@ -680,7 +680,8 @@ struct target_ops
        task Private_Data section of the Ada Task Control Block, and
        their interpretation depends on the target.  */
     ptid_t (*to_get_ada_task_ptid) (struct target_ops *,
-                                   long lwp, long thread);
+                                   long lwp, long thread)
+      TARGET_DEFAULT_FUNC (default_get_ada_task_ptid);
 
     /* Read one auxv entry from *READPTR, not reading locations >= ENDPTR.
        Return 0 if *READPTR is already at the end of the buffer.