aboutsummaryrefslogtreecommitdiff
path: root/gdb/top.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-05-16 09:58:45 -0600
committerTom Tromey <tom@tromey.com>2020-05-16 09:58:46 -0600
commit2dab0c7ba0d69bcc16cfe58da279ce915ef24348 (patch)
tree209bdb0dfa70f64c94d42dcb03d65d25e21a11c7 /gdb/top.h
parent59f7bd8d2b855162db6784c9724ead9e2377f32c (diff)
downloadgdb-2dab0c7ba0d69bcc16cfe58da279ce915ef24348.zip
gdb-2dab0c7ba0d69bcc16cfe58da279ce915ef24348.tar.gz
gdb-2dab0c7ba0d69bcc16cfe58da279ce915ef24348.tar.bz2
Remove ALL_UIS
Continuing my goal of removing the "ALL_*" iterator macros, this removes ALL_UIS, replacing it with an iterator adaptor. gdb/ChangeLog 2020-05-16 Tom Tromey <tom@tromey.com> * top.c (quit_force): Update. * infrun.c (handle_no_resumed): Update. * top.h (all_uis): New function. (ALL_UIS): Remove.
Diffstat (limited to 'gdb/top.h')
-rw-r--r--gdb/top.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/gdb/top.h b/gdb/top.h
index e98772a..fd99297 100644
--- a/gdb/top.h
+++ b/gdb/top.h
@@ -22,6 +22,7 @@
#include "gdbsupport/buffer.h"
#include "gdbsupport/event-loop.h"
+#include "gdbsupport/next-iterator.h"
#include "value.h"
struct tl_interp_info;
@@ -206,9 +207,12 @@ public:
#define SWITCH_THRU_ALL_UIS() \
for (switch_thru_all_uis stau_state; !stau_state.done (); stau_state.next ())
-/* Traverse over all UIs. */
-#define ALL_UIS(UI) \
- for (UI = ui_list; UI; UI = UI->next) \
+/* An adapter that can be used to traverse over all UIs. */
+static inline
+next_adapter<ui> all_uis ()
+{
+ return next_adapter<ui> (ui_list);
+}
/* Register the UI's input file descriptor in the event loop. */
extern void ui_register_input_event_handler (struct ui *ui);