ada-tasks.c: handle known tasks maintained by a simply-linked list.
authorJoel Brobecker <brobecker@gnat.com>
Mon, 4 Jul 2011 19:32:07 +0000 (19:32 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Mon, 4 Jul 2011 19:32:07 +0000 (19:32 +0000)
commit6040a59db5891821c1a73e88cd60adf125879a4f
tree116f9ae7cb1b302310791fce505accd2fc435a47
parentcb741e45a0ae3ab6009985b88b14e702919c690a
ada-tasks.c: handle known tasks maintained by a simply-linked list.

The mapping between Ada tasks, and the underlying threads is
normally maintained by the GNAT runtime under the known_tasks
array.  For performance reasons, this array is just a static
array with 10_000 entries in it. However, this is not very
practical in certain environments where memory is limited.
For those environments, the runtime has been enhanced to use
an alternate scheme with a linked list.

This change enhances the Ada tasking support to recognize this
situation and use the correct way of reading the tasks info
based on the the situation.

gdb/ChangeLog  (Tristan Gingold)

* ada-tasks.c (KNOWN_TASKS_LIST): New macro.
(tcb_fieldno): Add activation_link field.
(get_known_tasks_addr): Moved and rewritten.
(get_tcb_types_info): Set activation_link field.
(read_known_tasks_array): Add parameter.  Rewritten.
(read_known_tasks_list): New function.
(read_known_tasks): New function.
(ada_build_task_list): Call read_known_tasks instead of
read_known_tasks_array.
* ravenscar-thread.c: Add first_task_name constant.
(has_ravenscar_runtime): Check for task list too.
gdb/ChangeLog
gdb/ada-tasks.c
gdb/ravenscar-thread.c