diff options
author | Joel Brobecker <brobecker@gnat.com> | 2010-09-28 21:39:03 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2010-09-28 21:39:03 +0000 |
commit | 474011fbad9ea70b37691b05202488ee9904d65e (patch) | |
tree | 34ed98c8c6dd6cf713149fc7329cbcc10285c9f4 /gdb/ada-tasks.c | |
parent | c95e9f279130c09af2c427065700e3e08500b168 (diff) | |
download | gdb-474011fbad9ea70b37691b05202488ee9904d65e.zip gdb-474011fbad9ea70b37691b05202488ee9904d65e.tar.gz gdb-474011fbad9ea70b37691b05202488ee9904d65e.tar.bz2 |
[Ada] Add ada-tasks.c:iterate_over_live_ada_tasks
This new function is needed by the ravenscar-thread layer.
gdb/ChangeLog:
* ada-tasks.c (iterate_over_live_ada_tasks): New function.
* ada-lang.h (iterate_over_live_ada_tasks): Declare.
Diffstat (limited to 'gdb/ada-tasks.c')
-rw-r--r-- | gdb/ada-tasks.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c index 8e42252..3cbcc4f 100644 --- a/gdb/ada-tasks.c +++ b/gdb/ada-tasks.c @@ -212,6 +212,27 @@ ada_task_is_alive (struct ada_task_info *task_info) return (task_info->state != Terminated); } +/* Call the ITERATOR function once for each Ada task that hasn't been + terminated yet. */ + +void +iterate_over_live_ada_tasks (ada_task_list_iterator_ftype *iterator) +{ + int i, nb_tasks; + struct ada_task_info *task; + + ada_build_task_list (0); + nb_tasks = VEC_length (ada_task_info_s, task_list); + + for (i = 0; i < nb_tasks; i++) + { + task = VEC_index (ada_task_info_s, task_list, i); + if (!ada_task_is_alive (task)) + continue; + iterator (task); + } +} + /* Extract the contents of the value as a string whose length is LENGTH, and store the result in DEST. */ |