Use gdb::function_view in iterate_over_live_ada_tasks
authorTom Tromey <tromey@adacore.com>
Fri, 7 Aug 2020 16:26:45 +0000 (10:26 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 7 Aug 2020 16:26:46 +0000 (10:26 -0600)
This changes iterate_over_live_ada_tasks to accept a
gdb::function_view.  This is needed by a subsequent patch.

gdb/ChangeLog
2020-08-07  Tom Tromey  <tromey@adacore.com>

* ada-lang.h (ada_task_list_iterator_ftype): Now a
gdb::function_view.
(iterate_over_live_ada_tasks): Change type of argument.
* ada-tasks.c (iterate_over_live_ada_tasks): Change type
of argument.

gdb/ChangeLog
gdb/ada-lang.h
gdb/ada-tasks.c

index 7bee9c9cbbda24d5f4a3fdfb61cbf12adce74a87..cfa38cf301a65ebef0f83538cbf04ce1bf8f012e 100644 (file)
@@ -1,3 +1,11 @@
+2020-08-07  Tom Tromey  <tromey@adacore.com>
+
+       * ada-lang.h (ada_task_list_iterator_ftype): Now a
+       gdb::function_view.
+       (iterate_over_live_ada_tasks): Change type of argument.
+       * ada-tasks.c (iterate_over_live_ada_tasks): Change type
+       of argument.
+
 2020-08-07  Tom Tromey  <tromey@adacore.com>
 
        * ravenscar-thread.c (ravenscar_thread_target) <extra_thread_info>:
index 9be597942fdb2fec216187d5ebf10973628dbcb8..ae313ce700a158513d64a4c5653850c90113653e 100644 (file)
@@ -375,9 +375,10 @@ extern struct ada_task_info *ada_get_task_info_from_ptid (ptid_t ptid);
 
 extern int ada_get_task_number (thread_info *thread);
 
-typedef void (ada_task_list_iterator_ftype) (struct ada_task_info *task);
+typedef gdb::function_view<void (struct ada_task_info *task)>
+  ada_task_list_iterator_ftype;
 extern void iterate_over_live_ada_tasks
-  (ada_task_list_iterator_ftype *iterator);
+  (ada_task_list_iterator_ftype iterator);
 
 extern const char *ada_get_tcb_types_info (void);
 
index 27b458767a79c3731a2156f04bc4364056fb0816..d54c8b320a40e121d504b5994945c88254ad9e4e 100644 (file)
@@ -376,7 +376,7 @@ ada_get_task_info_from_ptid (ptid_t ptid)
    terminated yet.  */
 
 void
-iterate_over_live_ada_tasks (ada_task_list_iterator_ftype *iterator)
+iterate_over_live_ada_tasks (ada_task_list_iterator_ftype iterator)
 {
   struct ada_tasks_inferior_data *data;