[commit/Tru64] Ada tasking support on Tru64

Joel Brobecker brobecker@adacore.com
Thu Mar 5 23:57:00 GMT 2009


Hello,

Another tiny change - This is the target-specific part of Ada tasking
support on Tru64. Since I was looking at dec-threads, I figured I might
as well contribute this bit now.

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.

Tested on alpha-tru64. Checked in.

-- 
Joel
-------------- next part --------------
Index: dec-thread.c
===================================================================
RCS file: /cvs/src/src/gdb/dec-thread.c,v
retrieving revision 1.5
diff -u -p -r1.5 dec-thread.c
--- dec-thread.c	5 Mar 2009 23:37:19 -0000	1.5
+++ dec-thread.c	5 Mar 2009 23:38:50 -0000
@@ -660,6 +660,26 @@ dec_thread_new_objfile_observer (struct 
      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;
 }
 


More information about the Gdb-patches mailing list