aboutsummaryrefslogtreecommitdiff
path: root/gdb/ravenscar-thread.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2011-07-04 19:32:07 +0000
committerJoel Brobecker <brobecker@gnat.com>2011-07-04 19:32:07 +0000
commit6040a59db5891821c1a73e88cd60adf125879a4f (patch)
tree116f9ae7cb1b302310791fce505accd2fc435a47 /gdb/ravenscar-thread.c
parentcb741e45a0ae3ab6009985b88b14e702919c690a (diff)
downloadfsf-binutils-gdb-6040a59db5891821c1a73e88cd60adf125879a4f.zip
fsf-binutils-gdb-6040a59db5891821c1a73e88cd60adf125879a4f.tar.gz
fsf-binutils-gdb-6040a59db5891821c1a73e88cd60adf125879a4f.tar.bz2
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.
Diffstat (limited to 'gdb/ravenscar-thread.c')
-rw-r--r--gdb/ravenscar-thread.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c
index 173a524..b324fe7 100644
--- a/gdb/ravenscar-thread.c
+++ b/gdb/ravenscar-thread.c
@@ -51,6 +51,7 @@ static ptid_t base_ptid;
static const char running_thread_name[] = "__gnat_running_thread_table";
static const char known_tasks_name[] = "system__tasking__debug__known_tasks";
+static const char first_task_name[] = "system__tasking__debug__first_task";
static const char ravenscar_runtime_initializer[] =
"system__bb__threads__initialize";
@@ -135,10 +136,12 @@ has_ravenscar_runtime (void)
lookup_minimal_symbol (ravenscar_runtime_initializer, NULL, NULL);
struct minimal_symbol *msym_known_tasks =
lookup_minimal_symbol (known_tasks_name, NULL, NULL);
+ struct minimal_symbol *msym_first_task =
+ lookup_minimal_symbol (first_task_name, NULL, NULL);
struct minimal_symbol *msym_running_thread = get_running_thread_msymbol ();
return (msym_ravenscar_runtime_initializer
- && msym_known_tasks
+ && (msym_known_tasks || msym_first_task)
&& msym_running_thread);
}