[v2,08/12] Move event-loop.[ch] to gdbsupport/

Message ID 20200314185158.7816-9-tom@tromey.com
State New
Headers show
Series
  • Merge event loop implementations
Related show

Commit Message

Tom Tromey March 14, 2020, 6:51 p.m.
This moves event-loop.[ch] to gdbsupport/ and updates the uses in gdb.

gdb/ChangeLog
2020-03-14  Tom Tromey  <tom@tromey.com>

	* run-on-main-thread.c: Update include.
	* unittests/main-thread-selftests.c: Update include.
	* tui/tui-win.c: Update include.
	* tui/tui-io.c: Update include.
	* tui/tui-interp.c: Update include.
	* tui/tui-hooks.c: Update include.
	* top.h: Update include.
	* top.c: Update include.
	* ser-base.c: Update include.
	* remote.c: Update include.
	* remote-notif.c: Update include.
	* remote-fileio.c: Update include.
	* record-full.c: Update include.
	* record-btrace.c: Update include.
	* python/python.c: Update include.
	* posix-hdep.c: Update include.
	* mingw-hdep.c: Update include.
	* mi/mi-main.c: Update include.
	* mi/mi-interp.c: Update include.
	* main.c: Update include.
	* linux-nat.c: Update include.
	* interps.c: Update include.
	* infrun.c: Update include.
	* inf-loop.c: Update include.
	* event-top.c: Update include.
	* event-loop.c: Move to ../gdbsupport/.
	* event-loop.h: Move to ../gdbsupport/.
	* async-event.h: Update include.
	* Makefile.in (COMMON_SFILES, HFILES_NO_SRCDIR): Update.

gdbsupport/ChangeLog
2020-03-14  Tom Tromey  <tom@tromey.com>

	* event-loop.h: Move from ../gdb/.
	* event-loop.cc: Move from ../gdb/.
---
 gdb/ChangeLog                                | 32 ++++++++++++++++++++
 gdb/Makefile.in                              |  2 --
 gdb/async-event.h                            |  2 +-
 gdb/event-top.c                              |  2 +-
 gdb/inf-loop.c                               |  2 +-
 gdb/infrun.c                                 |  2 +-
 gdb/interps.c                                |  2 +-
 gdb/linux-nat.c                              |  2 +-
 gdb/main.c                                   |  2 +-
 gdb/mi/mi-interp.c                           |  2 +-
 gdb/mi/mi-main.c                             |  2 +-
 gdb/mingw-hdep.c                             |  2 +-
 gdb/posix-hdep.c                             |  2 +-
 gdb/python/python.c                          |  2 +-
 gdb/record-btrace.c                          |  2 +-
 gdb/record-full.c                            |  2 +-
 gdb/remote-fileio.c                          |  2 +-
 gdb/remote-notif.c                           |  2 +-
 gdb/remote.c                                 |  2 +-
 gdb/run-on-main-thread.c                     |  2 +-
 gdb/ser-base.c                               |  2 +-
 gdb/top.c                                    |  2 +-
 gdb/top.h                                    |  2 +-
 gdb/tui/tui-hooks.c                          |  2 +-
 gdb/tui/tui-interp.c                         |  2 +-
 gdb/tui/tui-io.c                             |  2 +-
 gdb/tui/tui-win.c                            |  2 +-
 gdb/unittests/main-thread-selftests.c        |  2 +-
 gdbsupport/ChangeLog                         |  5 +++
 gdbsupport/Makefile.am                       |  1 +
 gdbsupport/Makefile.in                       | 22 ++++++++------
 gdb/event-loop.c => gdbsupport/event-loop.cc |  4 +--
 {gdb => gdbsupport}/event-loop.h             |  0
 33 files changed, 78 insertions(+), 40 deletions(-)
 rename gdb/event-loop.c => gdbsupport/event-loop.cc (99%)
 rename {gdb => gdbsupport}/event-loop.h (100%)

-- 
2.17.2

Patch

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 31d443ff12b..cadd217b5fc 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1015,7 +1015,6 @@  COMMON_SFILES = \
 	dwarf2/read.c \
 	dwarf2/section.c \
 	eval.c \
-	event-loop.c \
 	event-top.c \
 	exceptions.c \
 	exec.c \
@@ -1250,7 +1249,6 @@  HFILES_NO_SRCDIR = \
 	dwarf2/index-common.h \
 	dwarf2/loc.h \
 	dwarf2/read.h \
-	event-loop.h \
 	event-top.h \
 	exceptions.h \
 	exec.h \
diff --git a/gdb/async-event.h b/gdb/async-event.h
index 408f7764f7c..3b3747a2604 100644
--- a/gdb/async-event.h
+++ b/gdb/async-event.h
@@ -19,7 +19,7 @@ 
 #ifndef ASYNC_EVENT_H
 #define ASYNC_EVENT_H
 
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 
 struct async_signal_handler;
 struct async_event_handler;
diff --git a/gdb/event-top.c b/gdb/event-top.c
index 5d7a77b5b4b..ac0f3701016 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -25,7 +25,7 @@ 
 #include "infrun.h"
 #include "target.h"
 #include "terminal.h"
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 #include "event-top.h"
 #include "interps.h"
 #include <signal.h>
diff --git a/gdb/inf-loop.c b/gdb/inf-loop.c
index 987a8ef48fe..c40ae239426 100644
--- a/gdb/inf-loop.c
+++ b/gdb/inf-loop.c
@@ -20,7 +20,7 @@ 
 #include "defs.h"
 #include "inferior.h"
 #include "infrun.h"
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 #include "event-top.h"
 #include "inf-loop.h"
 #include "remote.h"
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 4bf2527853a..18ac3be8307 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -56,7 +56,7 @@ 
 #include "target-dcache.h"
 #include "terminal.h"
 #include "solist.h"
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 #include "thread-fsm.h"
 #include "gdbsupport/enum-flags.h"
 #include "progspace-and-thread.h"
diff --git a/gdb/interps.c b/gdb/interps.c
index 8c01091e50b..4b2e3fd37b0 100644
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -32,7 +32,7 @@ 
 #include "defs.h"
 #include "gdbcmd.h"
 #include "ui-out.h"
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 #include "event-top.h"
 #include "interps.h"
 #include "completer.h"
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 81af83c4ac5..ae83dc10599 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -47,7 +47,7 @@ 
 #include <sys/stat.h>		/* for struct stat */
 #include <fcntl.h>		/* for O_RDONLY */
 #include "inf-loop.h"
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 #include "event-top.h"
 #include <pwd.h>
 #include <sys/types.h>
diff --git a/gdb/main.c b/gdb/main.c
index 67a3d0027e1..59cb14161be 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -28,7 +28,7 @@ 
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <ctype.h>
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 #include "ui-out.h"
 
 #include "interps.h"
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index e77093cfa28..7fe901bd68e 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -23,7 +23,7 @@ 
 
 #include "interps.h"
 #include "event-top.h"
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 #include "inferior.h"
 #include "infrun.h"
 #include "ui-out.h"
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 68cbcdd4fcd..9c6323e52c6 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -33,7 +33,7 @@ 
 #include "ui-out.h"
 #include "mi-out.h"
 #include "interps.h"
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 #include "event-top.h"
 #include "gdbcore.h"		/* For write_memory().  */
 #include "value.h"
diff --git a/gdb/mingw-hdep.c b/gdb/mingw-hdep.c
index 016cf2d2310..43d99747659 100644
--- a/gdb/mingw-hdep.c
+++ b/gdb/mingw-hdep.c
@@ -20,7 +20,7 @@ 
 #include "defs.h"
 #include "main.h"
 #include "serial.h"
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 
 #include "gdbsupport/gdb_select.h"
 
diff --git a/gdb/posix-hdep.c b/gdb/posix-hdep.c
index e5754cd701a..dfb230bc749 100644
--- a/gdb/posix-hdep.c
+++ b/gdb/posix-hdep.c
@@ -18,7 +18,7 @@ 
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 
 #include "gdbsupport/gdb_select.h"
 
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 6e243c1a07b..02543aea710 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -27,7 +27,7 @@ 
 #include "objfiles.h"
 #include "value.h"
 #include "language.h"
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 #include "readline/tilde.h"
 #include "python.h"
 #include "extension-priv.h"
diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c
index acc5f3ba663..2ca9a61457a 100644
--- a/gdb/record-btrace.c
+++ b/gdb/record-btrace.c
@@ -36,7 +36,7 @@ 
 #include "frame-unwind.h"
 #include "hashtab.h"
 #include "infrun.h"
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 #include "inf-loop.h"
 #include "inferior.h"
 #include <algorithm>
diff --git a/gdb/record-full.c b/gdb/record-full.c
index 4e1961af1bf..9c8bd18149b 100644
--- a/gdb/record-full.c
+++ b/gdb/record-full.c
@@ -31,7 +31,7 @@ 
 #include "record-full.h"
 #include "elf-bfd.h"
 #include "gcore.h"
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 #include "inf-loop.h"
 #include "gdb_bfd.h"
 #include "observable.h"
diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c
index f2dc9a66ead..df470fd86df 100644
--- a/gdb/remote-fileio.c
+++ b/gdb/remote-fileio.c
@@ -25,7 +25,7 @@ 
 #include "gdbsupport/gdb_wait.h"
 #include <sys/stat.h>
 #include "remote-fileio.h"
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 #include "target.h"
 #include "filenames.h"
 #include "gdbsupport/filestuff.h"
diff --git a/gdb/remote-notif.c b/gdb/remote-notif.c
index f41ebc3d735..2e5f124284b 100644
--- a/gdb/remote-notif.c
+++ b/gdb/remote-notif.c
@@ -35,7 +35,7 @@ 
 #include "remote.h"
 #include "remote-notif.h"
 #include "observable.h"
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 #include "target.h"
 #include "inferior.h"
 #include "infrun.h"
diff --git a/gdb/remote.c b/gdb/remote.c
index 01839d61c6a..8b5f01111ad 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -49,7 +49,7 @@ 
 
 #include "gdbsupport/gdb_sys_time.h"
 
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 #include "event-top.h"
 #include "inf-loop.h"
 
diff --git a/gdb/run-on-main-thread.c b/gdb/run-on-main-thread.c
index 74ab1e19a57..2cc93e430d8 100644
--- a/gdb/run-on-main-thread.c
+++ b/gdb/run-on-main-thread.c
@@ -22,7 +22,7 @@ 
 #if CXX_STD_THREAD
 #include <mutex>
 #endif
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 
 /* The serial event used when posting runnables.  */
 
diff --git a/gdb/ser-base.c b/gdb/ser-base.c
index 8231ec51543..fb6f4e056ad 100644
--- a/gdb/ser-base.c
+++ b/gdb/ser-base.c
@@ -20,7 +20,7 @@ 
 #include "defs.h"
 #include "serial.h"
 #include "ser-base.h"
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 
 #include "gdbsupport/gdb_select.h"
 #include "gdbsupport/gdb_sys_time.h"
diff --git a/gdb/top.c b/gdb/top.c
index 010aa6fb771..8b82bd3c038 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -42,7 +42,7 @@ 
 #include "gdbsupport/version.h"
 #include "serial.h"
 #include "main.h"
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 #include "gdbthread.h"
 #include "extension.h"
 #include "interps.h"
diff --git a/gdb/top.h b/gdb/top.h
index 638e02cad4c..2147e2d4b48 100644
--- a/gdb/top.h
+++ b/gdb/top.h
@@ -21,7 +21,7 @@ 
 #define TOP_H
 
 #include "gdbsupport/buffer.h"
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 #include "value.h"
 
 struct tl_interp_info;
diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c
index 0e45e0e7507..793ca0e4469 100644
--- a/gdb/tui/tui-hooks.c
+++ b/gdb/tui/tui-hooks.c
@@ -26,7 +26,7 @@ 
 #include "objfiles.h"
 #include "target.h"
 #include "gdbcore.h"
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 #include "event-top.h"
 #include "frame.h"
 #include "breakpoint.h"
diff --git a/gdb/tui/tui-interp.c b/gdb/tui/tui-interp.c
index 090cf0e0d0c..10118af2741 100644
--- a/gdb/tui/tui-interp.c
+++ b/gdb/tui/tui-interp.c
@@ -22,7 +22,7 @@ 
 #include "interps.h"
 #include "top.h"
 #include "event-top.h"
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 #include "ui-out.h"
 #include "cli-out.h"
 #include "tui/tui-data.h"
diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c
index b5ee2a2b6b6..e7a8ac77bce 100644
--- a/gdb/tui/tui-io.c
+++ b/gdb/tui/tui-io.c
@@ -21,7 +21,7 @@ 
 
 #include "defs.h"
 #include "target.h"
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 #include "event-top.h"
 #include "command.h"
 #include "top.h"
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index df7480fc57c..7cb4aa9bbd4 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -33,7 +33,7 @@ 
 #include "cli/cli-style.h"
 #include "top.h"
 #include "source.h"
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 #include "gdbcmd.h"
 #include "async-event.h"
 
diff --git a/gdb/unittests/main-thread-selftests.c b/gdb/unittests/main-thread-selftests.c
index c51f34ef41d..564a107b354 100644
--- a/gdb/unittests/main-thread-selftests.c
+++ b/gdb/unittests/main-thread-selftests.c
@@ -21,7 +21,7 @@ 
 #include "gdbsupport/selftest.h"
 #include "gdbsupport/block-signals.h"
 #include "run-on-main-thread.h"
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 #if CXX_STD_THREAD
 #include <thread>
 #endif
diff --git a/gdbsupport/Makefile.am b/gdbsupport/Makefile.am
index ee78a891b3b..e95ee5dbc50 100644
--- a/gdbsupport/Makefile.am
+++ b/gdbsupport/Makefile.am
@@ -46,6 +46,7 @@  libgdbsupport_a_SOURCES = \
     common-utils.cc \
     environ.cc \
     errors.cc \
+    event-loop.cc \
     fileio.cc \
     filestuff.cc \
     format.cc \
diff --git a/gdbsupport/Makefile.in b/gdbsupport/Makefile.in
index 7ed2e6fac23..5051ab31a49 100644
--- a/gdbsupport/Makefile.in
+++ b/gdbsupport/Makefile.in
@@ -149,16 +149,16 @@  am_libgdbsupport_a_OBJECTS = agent.$(OBJEXT) btrace-common.$(OBJEXT) \
 	buffer.$(OBJEXT) cleanups.$(OBJEXT) common-debug.$(OBJEXT) \
 	common-exceptions.$(OBJEXT) common-inferior.$(OBJEXT) \
 	common-regcache.$(OBJEXT) common-utils.$(OBJEXT) \
-	environ.$(OBJEXT) errors.$(OBJEXT) fileio.$(OBJEXT) \
-	filestuff.$(OBJEXT) format.$(OBJEXT) gdb-dlfcn.$(OBJEXT) \
-	gdb_tilde_expand.$(OBJEXT) gdb_wait.$(OBJEXT) \
-	gdb_vecs.$(OBJEXT) job-control.$(OBJEXT) netstuff.$(OBJEXT) \
-	new-op.$(OBJEXT) pathstuff.$(OBJEXT) print-utils.$(OBJEXT) \
-	ptid.$(OBJEXT) rsp-low.$(OBJEXT) run-time-clock.$(OBJEXT) \
-	safe-strerror.$(OBJEXT) scoped_mmap.$(OBJEXT) \
-	signals.$(OBJEXT) signals-state-save-restore.$(OBJEXT) \
-	tdesc.$(OBJEXT) thread-pool.$(OBJEXT) xml-utils.$(OBJEXT) \
-	$(am__objects_1)
+	environ.$(OBJEXT) errors.$(OBJEXT) event-loop.$(OBJEXT) \
+	fileio.$(OBJEXT) filestuff.$(OBJEXT) format.$(OBJEXT) \
+	gdb-dlfcn.$(OBJEXT) gdb_tilde_expand.$(OBJEXT) \
+	gdb_wait.$(OBJEXT) gdb_vecs.$(OBJEXT) job-control.$(OBJEXT) \
+	netstuff.$(OBJEXT) new-op.$(OBJEXT) pathstuff.$(OBJEXT) \
+	print-utils.$(OBJEXT) ptid.$(OBJEXT) rsp-low.$(OBJEXT) \
+	run-time-clock.$(OBJEXT) safe-strerror.$(OBJEXT) \
+	scoped_mmap.$(OBJEXT) signals.$(OBJEXT) \
+	signals-state-save-restore.$(OBJEXT) tdesc.$(OBJEXT) \
+	thread-pool.$(OBJEXT) xml-utils.$(OBJEXT) $(am__objects_1)
 libgdbsupport_a_OBJECTS = $(am_libgdbsupport_a_OBJECTS)
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -368,6 +368,7 @@  libgdbsupport_a_SOURCES = \
     common-utils.cc \
     environ.cc \
     errors.cc \
+    event-loop.cc \
     fileio.cc \
     filestuff.cc \
     format.cc \
@@ -471,6 +472,7 @@  distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common-utils.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/environ.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errors.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event-loop.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileio.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filestuff.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/format.Po@am__quote@
diff --git a/gdb/event-loop.c b/gdbsupport/event-loop.cc
similarity index 99%
rename from gdb/event-loop.c
rename to gdbsupport/event-loop.cc
index e5347d2e3f0..f7ccc4eec47 100644
--- a/gdb/event-loop.c
+++ b/gdbsupport/event-loop.cc
@@ -17,8 +17,8 @@ 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#include "defs.h"
-#include "event-loop.h"
+#include "gdbsupport/common-defs.h"
+#include "gdbsupport/event-loop.h"
 
 #include <chrono>
 
diff --git a/gdb/event-loop.h b/gdbsupport/event-loop.h
similarity index 100%
rename from gdb/event-loop.h
rename to gdbsupport/event-loop.h