[RFC,10/17] Move event-loop.[ch] to common/
Commit Message
This moves event-loop.[ch] to common and updates the uses in gdb.
gdb/ChangeLog
2019-02-24 Tom Tromey <tom@tromey.com>
* 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...
* common/event-loop.c: ... here.
* event-loop.h: Move...
* common/event-loop.h: ... here.
* async-event.h: Update include.
* Makefile.in (COMMON_SFILES, HFILES_NO_SRCDIR): Update.
---
gdb/ChangeLog | 32 ++++++++++++++++++++++++++++++++
gdb/Makefile.in | 4 ++--
gdb/async-event.h | 2 +-
gdb/{ => common}/event-loop.c | 4 ++--
gdb/{ => common}/event-loop.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/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 +-
28 files changed, 62 insertions(+), 28 deletions(-)
rename gdb/{ => common}/event-loop.c (99%)
rename gdb/{ => common}/event-loop.h (99%)
Comments
On 2/24/19 4:51 PM, Tom Tromey wrote:
> --- a/gdb/event-loop.h
> +++ b/gdb/common/event-loop.h
> @@ -70,6 +70,8 @@
>
> Corollary tasks are the creation and deletion of event sources. */
>
> +#include "common/function-view.h"
> +
Is this needed here?
> typedef void *gdb_client_data;
> typedef void (handler_func) (int, gdb_client_data);
> typedef void (timer_handler_func) (gdb_client_data);
Thanks,
Pedro Alves
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
>> +#include "common/function-view.h"
>> +
Pedro> Is this needed here?
Nope. I removed it.
Tom
@@ -961,6 +961,7 @@ COMMON_SFILES = \
common/common-utils.c \
common/errors.c \
common/environ.c \
+ common/event-loop.c \
common/fileio.c \
common/filestuff.c \
common/format.c \
@@ -1011,7 +1012,6 @@ COMMON_SFILES = \
dwarf2loc.c \
dwarf2read.c \
eval.c \
- event-loop.c \
event-top.c \
exceptions.c \
exec.c \
@@ -1240,7 +1240,6 @@ HFILES_NO_SRCDIR = \
dwarf2expr.h \
dwarf2loc.h \
dwarf2read.h \
- event-loop.h \
event-top.h \
exceptions.h \
exec.h \
@@ -1452,6 +1451,7 @@ HFILES_NO_SRCDIR = \
common/job-control.h \
common/errors.h \
common/environ.h \
+ common/event-loop.h \
common/fileio.h \
common/format.h \
common/gdb_assert.h \
@@ -19,7 +19,7 @@
#ifndef ASYNC_EVENT_H
#define ASYNC_EVENT_H
-#include "event-loop.h"
+#include "common/event-loop.h"
struct async_signal_handler;
struct async_event_handler;
similarity index 99%
rename from gdb/event-loop.c
rename to gdb/common/event-loop.c
@@ -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 "common/common-defs.h"
+#include "common/event-loop.h"
#include <chrono>
similarity index 99%
rename from gdb/event-loop.h
rename to gdb/common/event-loop.h
@@ -70,6 +70,8 @@
Corollary tasks are the creation and deletion of event sources. */
+#include "common/function-view.h"
+
typedef void *gdb_client_data;
typedef void (handler_func) (int, gdb_client_data);
typedef void (timer_handler_func) (gdb_client_data);
@@ -25,7 +25,7 @@
#include "infrun.h"
#include "target.h"
#include "terminal.h" /* for job_control */
-#include "event-loop.h"
+#include "common/event-loop.h"
#include "event-top.h"
#include "interps.h"
#include <signal.h>
@@ -20,7 +20,7 @@
#include "defs.h"
#include "inferior.h"
#include "infrun.h"
-#include "event-loop.h"
+#include "common/event-loop.h"
#include "event-top.h"
#include "inf-loop.h"
#include "remote.h"
@@ -61,7 +61,7 @@
#include "target-dcache.h"
#include "terminal.h"
#include "solist.h"
-#include "event-loop.h"
+#include "common/event-loop.h"
#include "thread-fsm.h"
#include "common/enum-flags.h"
#include "progspace-and-thread.h"
@@ -32,7 +32,7 @@
#include "defs.h"
#include "gdbcmd.h"
#include "ui-out.h"
-#include "event-loop.h"
+#include "common/event-loop.h"
#include "event-top.h"
#include "interps.h"
#include "completer.h"
@@ -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 "common/event-loop.h"
#include "event-top.h"
#include <pwd.h>
#include <sys/types.h>
@@ -28,7 +28,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <ctype.h>
-#include "event-loop.h"
+#include "common/event-loop.h"
#include "ui-out.h"
#include "interps.h"
@@ -20,7 +20,7 @@
#include "defs.h"
#include "interps.h"
#include "event-top.h"
-#include "event-loop.h"
+#include "common/event-loop.h"
#include "inferior.h"
#include "infrun.h"
#include "ui-out.h"
@@ -33,7 +33,7 @@
#include "ui-out.h"
#include "mi-out.h"
#include "interps.h"
-#include "event-loop.h"
+#include "common/event-loop.h"
#include "event-top.h"
#include "gdbcore.h" /* For write_memory(). */
#include "value.h"
@@ -20,7 +20,7 @@
#include "defs.h"
#include "main.h"
#include "serial.h"
-#include "event-loop.h"
+#include "common/event-loop.h"
#include "common/gdb_select.h"
#include "readline/readline.h"
@@ -18,7 +18,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "event-loop.h"
+#include "common/event-loop.h"
#include "common/gdb_select.h"
@@ -27,7 +27,7 @@
#include "objfiles.h"
#include "value.h"
#include "language.h"
-#include "event-loop.h"
+#include "common/event-loop.h"
#include "serial.h"
#include "readline/tilde.h"
#include "python.h"
@@ -36,7 +36,7 @@
#include "frame-unwind.h"
#include "hashtab.h"
#include "infrun.h"
-#include "event-loop.h"
+#include "common/event-loop.h"
#include "inf-loop.h"
#include "common/vec.h"
#include "inferior.h"
@@ -31,7 +31,7 @@
#include "record-full.h"
#include "elf-bfd.h"
#include "gcore.h"
-#include "event-loop.h"
+#include "common/event-loop.h"
#include "inf-loop.h"
#include "gdb_bfd.h"
#include "observable.h"
@@ -25,7 +25,7 @@
#include "common/gdb_wait.h"
#include <sys/stat.h>
#include "remote-fileio.h"
-#include "event-loop.h"
+#include "common/event-loop.h"
#include "target.h"
#include "filenames.h"
#include "common/filestuff.h"
@@ -35,7 +35,7 @@
#include "remote.h"
#include "remote-notif.h"
#include "observable.h"
-#include "event-loop.h"
+#include "common/event-loop.h"
#include "target.h"
#include "inferior.h"
#include "infrun.h"
@@ -49,7 +49,7 @@
#include "common/gdb_sys_time.h"
-#include "event-loop.h"
+#include "common/event-loop.h"
#include "event-top.h"
#include "inf-loop.h"
@@ -20,7 +20,7 @@
#include "defs.h"
#include "serial.h"
#include "ser-base.h"
-#include "event-loop.h"
+#include "common/event-loop.h"
#include "common/gdb_select.h"
#include "common/gdb_sys_time.h"
@@ -42,7 +42,7 @@
#include "common/version.h"
#include "serial.h"
#include "main.h"
-#include "event-loop.h"
+#include "common/event-loop.h"
#include "gdbthread.h"
#include "extension.h"
#include "interps.h"
@@ -21,7 +21,7 @@
#define TOP_H
#include "common/buffer.h"
-#include "event-loop.h"
+#include "common/event-loop.h"
#include "value.h"
struct tl_interp_info;
@@ -26,7 +26,7 @@
#include "objfiles.h"
#include "target.h"
#include "gdbcore.h"
-#include "event-loop.h"
+#include "common/event-loop.h"
#include "event-top.h"
#include "frame.h"
#include "breakpoint.h"
@@ -22,7 +22,7 @@
#include "interps.h"
#include "top.h"
#include "event-top.h"
-#include "event-loop.h"
+#include "common/event-loop.h"
#include "ui-out.h"
#include "cli-out.h"
#include "tui/tui-data.h"
@@ -21,7 +21,7 @@
#include "defs.h"
#include "target.h"
-#include "event-loop.h"
+#include "common/event-loop.h"
#include "event-top.h"
#include "command.h"
#include "top.h"
@@ -32,7 +32,7 @@
#include "cli/cli-cmds.h"
#include "top.h"
#include "source.h"
-#include "event-loop.h"
+#include "common/event-loop.h"
#include "async-event.h"
#include "tui/tui.h"