From: Tom Tromey Date: Mon, 13 Apr 2020 18:42:59 +0000 (-0600) Subject: Move gdb_select.h to gdbsupport/ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=06cc9596e8c8e431dcdfe2ce3f494e1431e95d6f;p=binutils-gdb.git Move gdb_select.h to gdbsupport/ This moves gdb_select.h to gdbsupport/, so it can be used by other code there. gdb/ChangeLog 2020-04-13 Tom Tromey * gdb_select.h: Move to ../gdbsupport/. * event-loop.c: Update include path. * top.c: Update include path. * ser-base.c: Update include path. * ui-file.c: Update include path. * ser-tcp.c: Update include path. * guile/scm-ports.c: Update include path. * posix-hdep.c: Update include path. * ser-unix.c: Update include path. * gdb_usleep.c: Update include path. * mingw-hdep.c: Update include path. * inflow.c: Update include path. * infrun.c: Update include path. * event-top.c: Update include path. gdbsupport/ChangeLog 2020-04-13 Tom Tromey * gdb_select.h: Move from ../gdb/. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c0ac38454e3..d8be389e01a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,20 @@ +2020-04-13 Tom Tromey + + * gdb_select.h: Move to ../gdbsupport/. + * event-loop.c: Update include path. + * top.c: Update include path. + * ser-base.c: Update include path. + * ui-file.c: Update include path. + * ser-tcp.c: Update include path. + * guile/scm-ports.c: Update include path. + * posix-hdep.c: Update include path. + * ser-unix.c: Update include path. + * gdb_usleep.c: Update include path. + * mingw-hdep.c: Update include path. + * inflow.c: Update include path. + * infrun.c: Update include path. + * event-top.c: Update include path. + 2020-04-13 Tom Tromey * configure: Rebuild. diff --git a/gdb/event-loop.c b/gdb/event-loop.c index 36df4767aa9..ae9d27eedd7 100644 --- a/gdb/event-loop.c +++ b/gdb/event-loop.c @@ -32,8 +32,7 @@ #include #include "gdbsupport/gdb_sys_time.h" -#include "gdb_select.h" -#include "observable.h" +#include "gdbsupport/gdb_select.h" #include "top.h" /* Tell create_file_handler what events we are interested in. diff --git a/gdb/event-top.c b/gdb/event-top.c index 1bfc28ea099..965ecd536f6 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -39,7 +39,7 @@ #include "maint.h" #include "gdbsupport/buffer.h" #include "ser-event.h" -#include "gdb_select.h" +#include "gdbsupport/gdb_select.h" #include "gdbsupport/gdb-sigmask.h" /* readline include files. */ diff --git a/gdb/gdb_select.h b/gdb/gdb_select.h deleted file mode 100644 index 69021ac28ea..00000000000 --- a/gdb/gdb_select.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Slightly more portable version of . - - Copyright (C) 2006-2020 Free Software Foundation, Inc. - - This file is part of GDB. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -#if !defined(GDB_SELECT_H) -#define GDB_SELECT_H - -#ifdef HAVE_SYS_SELECT_H -#include -#else -#include "gdbsupport/gdb_sys_time.h" -#endif - -#ifdef USE_WIN32API -#include -#endif - -extern int gdb_select (int n, fd_set *readfds, fd_set *writefds, - fd_set *exceptfds, struct timeval *timeout); - -/* Convenience wrapper around gdb_select that returns -1/EINTR if - set_quit_flag is set, either on entry or from a signal handler or - from a different thread while select is blocked. The quit flag is - not cleared on exit -- the caller is responsible to check it with - check_quit_flag or QUIT. - - Note this does NOT return -1/EINTR if any signal handler other than - SIGINT runs, nor if the current SIGINT handler does not call - set_quit_flag. */ -extern int interruptible_select (int n, - fd_set *readfds, - fd_set *writefds, - fd_set *exceptfds, - struct timeval *timeout); - -#endif /* !defined(GDB_SELECT_H) */ diff --git a/gdb/guile/scm-ports.c b/gdb/guile/scm-ports.c index 3f832dc753a..407d1d36f1f 100644 --- a/gdb/guile/scm-ports.c +++ b/gdb/guile/scm-ports.c @@ -22,7 +22,7 @@ conventions, et.al. */ #include "defs.h" -#include "gdb_select.h" +#include "gdbsupport/gdb_select.h" #include "top.h" #include "target.h" #include "guile-internal.h" diff --git a/gdb/inflow.c b/gdb/inflow.c index e5e595ed981..1b8e819436a 100644 --- a/gdb/inflow.c +++ b/gdb/inflow.c @@ -27,7 +27,7 @@ #include "observable.h" #include #include -#include "gdb_select.h" +#include "gdbsupport/gdb_select.h" #include "inflow.h" #include "gdbcmd.h" diff --git a/gdb/infrun.c b/gdb/infrun.c index 8ff34c382d6..88105e0801c 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -64,7 +64,7 @@ #include "arch-utils.h" #include "gdbsupport/scope-exit.h" #include "gdbsupport/forward-scope-exit.h" -#include "gdb_select.h" +#include "gdbsupport/gdb_select.h" #include /* Prototypes for local functions */ diff --git a/gdb/mingw-hdep.c b/gdb/mingw-hdep.c index cc425491dc9..016cf2d2310 100644 --- a/gdb/mingw-hdep.c +++ b/gdb/mingw-hdep.c @@ -22,7 +22,7 @@ #include "serial.h" #include "event-loop.h" -#include "gdb_select.h" +#include "gdbsupport/gdb_select.h" #include diff --git a/gdb/posix-hdep.c b/gdb/posix-hdep.c index cca72418aac..e5754cd701a 100644 --- a/gdb/posix-hdep.c +++ b/gdb/posix-hdep.c @@ -20,7 +20,7 @@ #include "defs.h" #include "event-loop.h" -#include "gdb_select.h" +#include "gdbsupport/gdb_select.h" /* Wrapper for select. Nothing special needed on POSIX platforms. */ diff --git a/gdb/ser-base.c b/gdb/ser-base.c index 89d9a695c2f..8231ec51543 100644 --- a/gdb/ser-base.c +++ b/gdb/ser-base.c @@ -22,7 +22,7 @@ #include "ser-base.h" #include "event-loop.h" -#include "gdb_select.h" +#include "gdbsupport/gdb_select.h" #include "gdbsupport/gdb_sys_time.h" #ifdef USE_WIN32API #include diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c index c5581744f99..1c6d5a346c6 100644 --- a/gdb/ser-tcp.c +++ b/gdb/ser-tcp.c @@ -58,7 +58,7 @@ #endif #include -#include "gdb_select.h" +#include "gdbsupport/gdb_select.h" #include #ifndef HAVE_SOCKLEN_T diff --git a/gdb/ser-unix.c b/gdb/ser-unix.c index 8000e352a09..9a13acddbc8 100644 --- a/gdb/ser-unix.c +++ b/gdb/ser-unix.c @@ -28,7 +28,7 @@ #include #include "gdbsupport/gdb_sys_time.h" -#include "gdb_select.h" +#include "gdbsupport/gdb_select.h" #include "gdbcmd.h" #include "gdbsupport/filestuff.h" #include diff --git a/gdb/top.c b/gdb/top.c index e2432489dc8..010aa6fb771 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -51,7 +51,7 @@ #include "filenames.h" #include "frame.h" #include "gdbsupport/buffer.h" -#include "gdb_select.h" +#include "gdbsupport/gdb_select.h" #include "gdbsupport/scope-exit.h" #include "gdbarch.h" #include "gdbsupport/pathstuff.h" diff --git a/gdb/ui-file.c b/gdb/ui-file.c index f3adbd014aa..a7b63a494b9 100644 --- a/gdb/ui-file.c +++ b/gdb/ui-file.c @@ -22,7 +22,7 @@ #include "defs.h" #include "ui-file.h" #include "gdb_obstack.h" -#include "gdb_select.h" +#include "gdbsupport/gdb_select.h" #include "gdbsupport/filestuff.h" #include "cli/cli-style.h" diff --git a/gdbsupport/ChangeLog b/gdbsupport/ChangeLog index 0d0ea875a49..880a6ae7658 100644 --- a/gdbsupport/ChangeLog +++ b/gdbsupport/ChangeLog @@ -1,3 +1,7 @@ +2020-04-13 Tom Tromey + + * gdb_select.h: Move from ../gdb/. + 2020-04-13 Tom Tromey * config.in, configure: Rebuild. diff --git a/gdbsupport/gdb_select.h b/gdbsupport/gdb_select.h new file mode 100644 index 00000000000..69021ac28ea --- /dev/null +++ b/gdbsupport/gdb_select.h @@ -0,0 +1,51 @@ +/* Slightly more portable version of . + + Copyright (C) 2006-2020 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#if !defined(GDB_SELECT_H) +#define GDB_SELECT_H + +#ifdef HAVE_SYS_SELECT_H +#include +#else +#include "gdbsupport/gdb_sys_time.h" +#endif + +#ifdef USE_WIN32API +#include +#endif + +extern int gdb_select (int n, fd_set *readfds, fd_set *writefds, + fd_set *exceptfds, struct timeval *timeout); + +/* Convenience wrapper around gdb_select that returns -1/EINTR if + set_quit_flag is set, either on entry or from a signal handler or + from a different thread while select is blocked. The quit flag is + not cleared on exit -- the caller is responsible to check it with + check_quit_flag or QUIT. + + Note this does NOT return -1/EINTR if any signal handler other than + SIGINT runs, nor if the current SIGINT handler does not call + set_quit_flag. */ +extern int interruptible_select (int n, + fd_set *readfds, + fd_set *writefds, + fd_set *exceptfds, + struct timeval *timeout); + +#endif /* !defined(GDB_SELECT_H) */