Implement the target-specific part of Ada tasking support
authorJoel Brobecker <brobecker@gnat.com>
Thu, 5 Mar 2009 23:42:32 +0000 (23:42 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Thu, 5 Mar 2009 23:42:32 +0000 (23:42 +0000)
        on Tru64.

        * dec-thread.c (dec_thread_get_ada_task_ptid): New function.
        (init_dec_thread_ops): Set the to_get_ada_task_ptid method.

gdb/ChangeLog
gdb/dec-thread.c

index cbacc27c3d8cca2edfcc08b4d963513f81bee55e..eb4c4908bc162271fd82f8bf4f0c6265e2e30ba2 100644 (file)
@@ -1,3 +1,11 @@
+2009-03-05  Joel Brobecker  <brobecker@adacore.com>
+
+       Implement the target-specific part of Ada tasking support
+       on Tru64.
+
+       * dec-thread.c (dec_thread_get_ada_task_ptid): New function.
+       (init_dec_thread_ops): Set the to_get_ada_task_ptid method.
+
 2009-03-05  Joel Brobecker  <brobecker@adacore.com>
 
        Get rid of the global "base_target" and use "find_target_beneath"
index 95f2f52618a6d8d46a1d7647202ebdafa96df5b2..aa40c5988a92432f895d44072971fa328eb83787 100644 (file)
@@ -660,6 +660,26 @@ dec_thread_new_objfile_observer (struct objfile *objfile)
      disable_dec_thread ();
 }
 
+/* The "to_get_ada_task_ptid" method of the dec_thread_ops.  */
+
+static ptid_t
+dec_thread_get_ada_task_ptid (long lwp, long thread)
+{
+  int i;
+  struct dec_thread_info *info;
+
+  debug ("dec_thread_get_ada_task_ptid (lwp=0x%lx, thread=0x%lx)",
+         lwp, thread);
+
+  for (i = 0; VEC_iterate (dec_thread_info_s, dec_thread_list, i, info);
+       i++)
+    if (info->info.teb == (pthread_t) thread)
+      return ptid_build_from_info (*info);
+  
+  warning (_("Could not find thread id from THREAD = 0x%lx\n"), thread);
+  return inferior_ptid;
+}
+
 static void
 init_dec_thread_ops (void)
 {
@@ -674,6 +694,7 @@ init_dec_thread_ops (void)
   dec_thread_ops.to_thread_alive       = dec_thread_thread_alive;
   dec_thread_ops.to_pid_to_str         = dec_thread_pid_to_str;
   dec_thread_ops.to_stratum            = thread_stratum;
+  dec_thread_ops.to_get_ada_task_ptid  = dec_thread_get_ada_task_ptid;
   dec_thread_ops.to_magic              = OPS_MAGIC;
 }
 
This page took 0.027955 seconds and 4 git commands to generate.