diff mbox

[RFA,4/8] Use gdb::function_view in iterate_over_live_ada_tasks

Message ID 20190326144404.6670-5-tromey@adacore.com
State New
Headers show

Commit Message

Tom Tromey March 26, 2019, 2:44 p.m. UTC
This changes iterate_over_live_ada_tasks to accept a
gdb::function_view.  This is needed by a subsequent patch.

gdb/ChangeLog
2019-03-26  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   | 8 ++++++++
 gdb/ada-lang.h  | 6 ++++--
 gdb/ada-tasks.c | 2 +-
 3 files changed, 13 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h
index ee03dbd2aad..d79e5f0d5ac 100644
--- a/gdb/ada-lang.h
+++ b/gdb/ada-lang.h
@@ -28,6 +28,7 @@  struct parser_state;
 #include "value.h"
 #include "gdbtypes.h"
 #include "breakpoint.h"
+#include "common/function-view.h"
 #include "common/vec.h"
 
 /* Names of specific files known to be part of the runtime
@@ -405,9 +406,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);
 
diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c
index ccabc631040..09b28a45af0 100644
--- a/gdb/ada-tasks.c
+++ b/gdb/ada-tasks.c
@@ -387,7 +387,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;