summaryrefslogtreecommitdiff
path: root/gdb/dec-thread.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2009-03-05 23:42:31 +0000
committerJoel Brobecker <brobecker@gnat.com>2009-03-05 23:42:31 +0000
commitf1c4daa594919152e47c111c830393e10530443a (patch)
treed881613cdb1b4aef8ad50b8081c742433fa5c44b /gdb/dec-thread.c
parent3e5fb2e1453d9b8d09983a5a3d1d3ff203e8352a (diff)
downloadgdb-f1c4daa594919152e47c111c830393e10530443a.tar.gz
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.
Diffstat (limited to 'gdb/dec-thread.c')
-rw-r--r--gdb/dec-thread.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gdb/dec-thread.c b/gdb/dec-thread.c
index 95f2f52618a..aa40c5988a9 100644
--- a/gdb/dec-thread.c
+++ b/gdb/dec-thread.c
@@ -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;
}