Minor Ada task cleanups
authorTom Tromey <tromey@adacore.com>
Fri, 15 Feb 2019 21:05:38 +0000 (14:05 -0700)
committerTom Tromey <tromey@adacore.com>
Tue, 19 Feb 2019 19:26:37 +0000 (12:26 -0700)
commit98814c6c111a0681e691a72834c8dcc5b8d1bb3a
tree569c709c9438d99160649efbe94acd546877a4d6
parent6f2117ba3892110badc65a7126b19cec211acfa2
Minor Ada task cleanups

While working on the Ada task code, I noticed a few things that could
be cleaned up:

* task_list_valid_p was not set in all cases in ada_build_task_list.
  This causes many needless re-fetches of the task list.

* task_list_valid_p can be bool, and various functions can also return
  bool.

* Nothing checks the return value of read_known_tasks, so it can be
  changed to return void.

* The call to ada_build_task_list in
  ravenscar_thread_target::update_thread_list is redundant, because
  this is the first thing done by iterate_over_live_ada_tasks.

Tested using the internal AdaCore test suite against a ravenscar
target.

gdb/ChangeLog
2019-02-19  Tom Tromey  <tromey@adacore.com>

* ravenscar-thread.c
(ravenscar_thread_target::update_thread_list): Don't call
ada_build_task_list.
* ada-lang.h (ada_build_task_list): Don't declare.
* ada-tasks.c (struct ada_tasks_inferior_data)
<task_list_valid_p>: Now bool.
(read_known_tasks, ada_task_list_changed)
(ada_tasks_invalidate_inferior_data): Update.
(read_known_tasks_array): Return bool.
(read_known_tasks_list): Likewise.
(read_known_tasks): Return void.
(ada_build_task_list): Now static.
gdb/ChangeLog
gdb/ada-lang.h
gdb/ada-tasks.c
gdb/ravenscar-thread.c