]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: move a bunch of quit-related things to event-top.{c,h}
authorSimon Marchi <simon.marchi@polymtl.ca>
Tue, 23 Apr 2024 13:22:59 +0000 (09:22 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Tue, 23 Apr 2024 15:26:14 +0000 (11:26 -0400)
Move some declarations related to the "quit" machinery from defs.h to
event-top.h.  Most of the definitions associated to these declarations
are in event-top.c.  The exceptions are `quit()` and `maybe_quit()`,
that are defined in utils.c.  For consistency, move these two
definitions to event-top.c.

Include "event-top.h" in many files that use these things.

Change-Id: I6594f6df9047a9a480e7b9934275d186afb14378
Approved-By: Tom Tromey <tom@tromey.com>
51 files changed:
gdb/ada-lang.c
gdb/ada-typeprint.c
gdb/ada-valprint.c
gdb/addrmap.c
gdb/amd64-windows-tdep.c
gdb/breakpoint.c
gdb/c-typeprint.c
gdb/cli/cli-script.c
gdb/coffread.c
gdb/corefile.c
gdb/cp-valprint.c
gdb/dbxread.c
gdb/defs.h
gdb/disasm.c
gdb/dwarf2/cooked-index.c
gdb/dwarf2/expr.c
gdb/dwarf2/loc.c
gdb/dwarf2/read-gdb-index.c
gdb/dwarf2/read.c
gdb/event-top.c
gdb/event-top.h
gdb/f-typeprint.c
gdb/findvar.c
gdb/frame.c
gdb/gdb_bfd.c
gdb/linux-fork.c
gdb/m2-lang.c
gdb/m2-typeprint.c
gdb/mi/mi-cmd-stack.c
gdb/objc-lang.c
gdb/p-lang.c
gdb/p-typeprint.c
gdb/printcmd.c
gdb/psymtab.c
gdb/remote-fileio.c
gdb/remote-sim.c
gdb/rust-lang.c
gdb/ser-base.c
gdb/skip.c
gdb/solib-rocm.c
gdb/sparc64-tdep.c
gdb/stabsread.c
gdb/stack.c
gdb/symmisc.c
gdb/symtab.c
gdb/tracepoint.c
gdb/tui/tui.c
gdb/utils.c
gdb/valops.c
gdb/valprint.c
gdb/xcoffread.c

index 5ab6e8b14b72d6994d7c1d6d315f360973ebaa26..e33a746da9e88f7121d2c5022138f83c9fb28705 100644 (file)
@@ -19,6 +19,7 @@
 
 
 #include <ctype.h>
+#include "event-top.h"
 #include "extract-store-integer.h"
 #include "gdbsupport/gdb_regex.h"
 #include "frame.h"
index deead1055dbf4859e3bf930612d4d20dc15baf0a..915f8b54d50ea70ab5e241cf619fc5405d0e7ae9 100644 (file)
@@ -17,6 +17,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "bfd.h"
+#include "event-top.h"
 #include "gdbtypes.h"
 #include "value.h"
 #include "c-lang.h"
index 6d3fca9bdeba85d64727cdb75de6c355b34d1958..937bd39e87dbacddca382be968876d523a8d215d 100644 (file)
@@ -18,6 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <ctype.h>
+#include "event-top.h"
 #include "extract-store-integer.h"
 #include "gdbtypes.h"
 #include "expression.h"
index c6e037330ecc7dbb6910ef646937d4511d5573f4..b9a0f77d5d0b8f5a791e36598e1f3236bbf89b2c 100644 (file)
@@ -17,6 +17,7 @@
    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 "event-top.h"
 #include "gdbsupport/gdb_obstack.h"
 #include "addrmap.h"
 #include "gdbsupport/selftest.h"
index 3dfc8000533985a1d1240c034b3855ed1bdc98fa..9636201d13a62b987be151099758245c174b925c 100644 (file)
@@ -15,6 +15,7 @@
    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 "event-top.h"
 #include "extract-store-integer.h"
 #include "osabi.h"
 #include "amd64-tdep.h"
index 6d8adc626643d137af02371d5151468f12b82691..03e073d787926daa1cec55661e0317ad4fabb3af 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "arch-utils.h"
 #include <ctype.h>
+#include "event-top.h"
 #include "hashtab.h"
 #include "symtab.h"
 #include "frame.h"
index 3e299356308c7d4001cded7cb284ca77907d0c67..62cf7219a415254ed7ea6295ae90079c97547b51 100644 (file)
@@ -16,6 +16,7 @@
    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 "event-top.h"
 #include "gdbsupport/gdb_obstack.h"
 #include "bfd.h"
 #include "symtab.h"
index 2f731807c94fd86c362fd5ab31f9a412ec991e33..03e0a2e43e3c7d875605287c18d0013e626933ea 100644 (file)
@@ -17,6 +17,7 @@
    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 "event-top.h"
 #include "value.h"
 #include <ctype.h>
 
index 327c014a5a4c9a1c91d7bd85e916601a2aa1f841..daae3ffe989c04ecdaa5e891ed2ab6a380e4487a 100644 (file)
@@ -17,6 +17,7 @@
    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 "event-top.h"
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "demangle.h"
index 984c7bef8800ae938f86dde55cbde6e77c163177..8caf3bff383f5b85f695c9197edb78e2cd48ac0a 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <signal.h>
 #include <fcntl.h>
+#include "event-top.h"
 #include "extract-store-integer.h"
 #include "inferior.h"
 #include "symtab.h"
index 2e776f40a637660e2e9b2f1cb1f8e3cb990447a0..ae28882e1789d8f0ea6d6b57e5ed0a176774c586 100644 (file)
@@ -17,6 +17,7 @@
    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 "event-top.h"
 #include "extract-store-integer.h"
 #include "gdbsupport/gdb_obstack.h"
 #include "symtab.h"
index 9faaf0e7381bd2fa87c835dca8735e0dfa5e0e26..830dd1cc611298632418206c452534fe1cbc6eeb 100644 (file)
@@ -31,6 +31,7 @@
    for real.  dbx_psymtab_to_symtab() is the function that does this */
 
 
+#include "event-top.h"
 #include "gdbsupport/gdb_obstack.h"
 #include <sys/stat.h>
 #include "symtab.h"
index 6f9c0d1f781a6f7974557f93383fa98f523ac5c5..11e2190c3e4aec9cff07586c937618af7717d983 100644 (file)
@@ -94,50 +94,6 @@ extern std::string python_libdir;
 /* * Search path for separate debug files.  */
 extern std::string debug_file_directory;
 
-/* The current quit handler (and its type).  This is called from the
-   QUIT macro.  See default_quit_handler below for default behavior.
-   Parts of GDB temporarily override this to e.g., completely suppress
-   Ctrl-C because it would not be safe to throw.  E.g., normally, you
-   wouldn't want to quit between a RSP command and its response, as
-   that would break the communication with the target, but you may
-   still want to intercept the Ctrl-C and offer to disconnect if the
-   user presses Ctrl-C multiple times while the target is stuck
-   waiting for the wedged remote stub.  */
-typedef void (quit_handler_ftype) (void);
-extern quit_handler_ftype *quit_handler;
-
-/* The default quit handler.  Checks whether Ctrl-C was pressed, and
-   if so:
-
-     - If GDB owns the terminal, throws a quit exception.
-
-     - If GDB does not own the terminal, forwards the Ctrl-C to the
-       target.
-*/
-extern void default_quit_handler (void);
-
-/* Flag that function quit should call quit_force.  */
-extern volatile bool sync_quit_force_run;
-
-/* Set sync_quit_force_run and also call set_quit_flag().  */
-extern void set_force_quit_flag ();
-
-extern void quit (void);
-
-/* Helper for the QUIT macro.  */
-
-extern void maybe_quit (void);
-
-/* Check whether a Ctrl-C was typed, and if so, call the current quit
-   handler.  */
-#define QUIT maybe_quit ()
-
-/* Set the serial event associated with the quit flag.  */
-extern void quit_serial_event_set (void);
-
-/* Clear the serial event associated with the quit flag.  */
-extern void quit_serial_event_clear (void);
-
 /* * Languages represented in the symbol table and elsewhere.
    This should probably be in language.h, but since enum's can't
    be forward declared to satisfy opaque references before their
index da6f3afba7a102b9fa89f38bdb0b1208041a5e3b..e54b8521dde36496d6bbc483c4df4d09e895461c 100644 (file)
@@ -18,6 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "arch-utils.h"
+#include "event-top.h"
 #include "target.h"
 #include "value.h"
 #include "ui-out.h"
index 190ceebe1608e755b79a97bbccd78f18420e4800..3b95c075a557c1dd644bbe1c662659ab72ab7941 100644 (file)
@@ -24,6 +24,7 @@
 #include "cp-support.h"
 #include "c-lang.h"
 #include "ada-lang.h"
+#include "event-top.h"
 #include "split-name.h"
 #include "observable.h"
 #include "run-on-main-thread.h"
index d92facbf0dcff23c81943604a248ab666c0a512f..cb80dbf60b1f2ea4390dbf342aced3b18e6116ba 100644 (file)
@@ -20,6 +20,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "block.h"
+#include "event-top.h"
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "value.h"
index 205d2ba56cbb813b7c021c38b2f949d603e83e67..23c57bde93916f6fd00676f0df1c50708134e285 100644 (file)
@@ -19,6 +19,7 @@
    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 "event-top.h"
 #include "ui-out.h"
 #include "value.h"
 #include "frame.h"
index 8c0895b96393e28343b47f0a73480fa97113b007..e743ce13978d1bbfb908d216f78bf676f5d5a99c 100644 (file)
@@ -22,6 +22,7 @@
 #include "cli/cli-cmds.h"
 #include "complaints.h"
 #include "dwz.h"
+#include "event-top.h"
 #include "gdb/gdb-index.h"
 #include "gdbsupport/gdb-checked-static-cast.h"
 #include "mapped-index.h"
index 96e51bb42b0f52f884a0059995358274cb7cb5c7..501d6c0c992cc0395878fb28125842bc5a8ef461 100644 (file)
@@ -47,6 +47,7 @@
 #include "dwarf2/public.h"
 #include "bfd.h"
 #include "elf-bfd.h"
+#include "event-top.h"
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "objfiles.h"
index 8411ec5028a58f23d97218c7f8624d58d898f745..2fcbad6b937b42ccb3ccaa6e7dcf25482214c576 100644 (file)
@@ -19,6 +19,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 "gdbsupport/job-control.h"
+#include "run-on-main-thread.h"
 #include "top.h"
 #include "ui.h"
 #include "inferior.h"
@@ -1062,15 +1064,55 @@ gdb_init_signals (void)
   install_handle_sigsegv ();
 }
 
-/* See defs.h.  */
+/* See event-top.h.  */
 
 void
-quit_serial_event_set (void)
+quit (void)
+{
+  if (sync_quit_force_run)
+    {
+      sync_quit_force_run = false;
+      throw_forced_quit ("SIGTERM");
+    }
+
+#ifdef __MSDOS__
+  /* No steenking SIGINT will ever be coming our way when the
+     program is resumed.  Don't lie.  */
+  throw_quit ("Quit");
+#else
+  if (job_control
+      /* If there is no terminal switching for this target, then we can't
+        possibly get screwed by the lack of job control.  */
+      || !target_supports_terminal_ours ())
+    throw_quit ("Quit");
+  else
+    throw_quit ("Quit (expect signal SIGINT when the program is resumed)");
+#endif
+}
+
+/* See event-top.h.  */
+
+void
+maybe_quit ()
+{
+  if (!is_main_thread ())
+    return;
+
+  if (sync_quit_force_run)
+    quit ();
+
+  quit_handler ();
+}
+
+/* See event-top.h.  */
+
+void
+quit_serial_event_set ()
 {
   serial_event_set (quit_serial_event);
 }
 
-/* See defs.h.  */
+/* See event-top.h.  */
 
 void
 quit_serial_event_clear (void)
index f431f2812b21a6a0e517481021c1a1c6606ba42d..846d1e48289314d114d9847ac07a338a90426629 100644 (file)
 
 struct cmd_list_element;
 
+/* The current quit handler (and its type).  This is called from the
+   QUIT macro.  See default_quit_handler below for default behavior.
+   Parts of GDB temporarily override this to e.g., completely suppress
+   Ctrl-C because it would not be safe to throw.  E.g., normally, you
+   wouldn't want to quit between a RSP command and its response, as
+   that would break the communication with the target, but you may
+   still want to intercept the Ctrl-C and offer to disconnect if the
+   user presses Ctrl-C multiple times while the target is stuck
+   waiting for the wedged remote stub.  */
+typedef void (quit_handler_ftype) ();
+extern quit_handler_ftype *quit_handler;
+
 /* Exported functions from event-top.c.
    FIXME: these should really go into top.h.  */
 
+/* The default quit handler.  Checks whether Ctrl-C was pressed, and
+   if so:
+
+     - If GDB owns the terminal, throws a quit exception.
+
+     - If GDB does not own the terminal, forwards the Ctrl-C to the
+       target.
+*/
+
+extern void default_quit_handler ();
+
+/* Flag that function quit should call quit_force.  */
+
+extern volatile bool sync_quit_force_run;
+
+/* Set sync_quit_force_run and also call set_quit_flag().  */
+
+extern void set_force_quit_flag ();
+
+/* Control C eventually causes this to be called, at a convenient time.  */
+
+extern void quit ();
+
+/* Helper for the QUIT macro.  */
+
+extern void maybe_quit ();
+
+/* Check whether a Ctrl-C was typed, and if so, call the current quit
+   handler.  */
+
+#define QUIT maybe_quit ()
+
+/* Set the serial event associated with the quit flag.  */
+
+extern void quit_serial_event_set ();
+
+/* Clear the serial event associated with the quit flag.  */
+
+extern void quit_serial_event_clear ();
+
 extern void display_gdb_prompt (const char *new_prompt);
 extern void gdb_setup_readline (int);
 extern void gdb_disable_readline (void);
index 6e9722dbeb85d3fc9cf47bd3d442808a3895e4a6..42e1cfb871bbcfbb9a3565157e017a9de75192b1 100644 (file)
@@ -20,6 +20,7 @@
    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 "event-top.h"
 #include "gdbsupport/gdb_obstack.h"
 #include "bfd.h"
 #include "symtab.h"
index 660eb11c8b8e76897ad16d3cab8f930548068882..df4ab1a28b9d3786ac9c514f7326fffca8cae8e0 100644 (file)
@@ -17,6 +17,7 @@
    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 "event-top.h"
 #include "extract-store-integer.h"
 #include "symtab.h"
 #include "gdbtypes.h"
index 719fa051afc6aed2361bd03f496d75dc98f03d35..0232bdb6865c995cfe2416f2ee2530cb8ebec23c 100644 (file)
@@ -18,6 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "frame.h"
+#include "event-top.h"
 #include "extract-store-integer.h"
 #include "target.h"
 #include "value.h"
index 1462aaf0f89c0582507bffe9395028e16f55bfe0..6e97b2168139b0256c841846a3f31c1cf1e828dc 100644 (file)
@@ -18,6 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "gdb_bfd.h"
+#include "event-top.h"
 #include "ui-out.h"
 #include "gdbcmd.h"
 #include "hashtab.h"
index bb8119a36d05147c18b9fbb0195c6263fb25ff09..867cb187c8af3f5dd6c79e74e563078ede45993c 100644 (file)
@@ -18,6 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "arch-utils.h"
+#include "event-top.h"
 #include "inferior.h"
 #include "infrun.h"
 #include "regcache.h"
index 86fef96dec189abb9d6078c9f0bfc53bed935f13..5e9faa67de3927d13d7bcf77423e60f620111a0c 100644 (file)
@@ -17,6 +17,7 @@
    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 "event-top.h"
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "expression.h"
index 32cc930cfb8df823347762d6f36cb079dce01bd7..c0ae72203c32b865cf73a2aeb177b4544e7f8124 100644 (file)
@@ -16,6 +16,7 @@
    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 "event-top.h"
 #include "language.h"
 #include "gdbsupport/gdb_obstack.h"
 #include "bfd.h"
index b78c169e70bc60736bd87c149974a76b8418ee40..5e504283fcfc17dbcd6246143c30fd451cb5a0c0 100644 (file)
@@ -17,6 +17,7 @@
    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 "event-top.h"
 #include "target.h"
 #include "frame.h"
 #include "value.h"
index e492c82845b3889b6e6dde7f6c9129e8300596dc..b36816898a5e2408286e713d4253d70aaadf62d7 100644 (file)
@@ -20,6 +20,7 @@
    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 "event-top.h"
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "expression.h"
index ddacccce1b297f92bda8724cd6e3af094c401826..d3d491c54cd258c1bbef3d9bbeb4463ccd811532 100644 (file)
@@ -19,6 +19,7 @@
 
 /* This file is derived from c-lang.c */
 
+#include "event-top.h"
 #include "extract-store-integer.h"
 #include "symtab.h"
 #include "gdbtypes.h"
index ad98d9ef20256409cef17f8ea4b39f598b030ad0..95a7f6041c1d641074b4224e0977cfb257f7a7e4 100644 (file)
@@ -18,6 +18,7 @@
 
 /* This file is derived from p-typeprint.c */
 
+#include "event-top.h"
 #include "gdbsupport/gdb_obstack.h"
 #include "bfd.h"
 #include "symtab.h"
index 79da7ea4e22edcdc3ad498d1b82b5dc6f53c9fa1..66669f105c5c4e9c8c4bedf88e53b206f028f24e 100644 (file)
@@ -17,6 +17,7 @@
    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 "event-top.h"
 #include "extract-store-integer.h"
 #include "frame.h"
 #include "symtab.h"
index a4f5b04627c2adec16ea978c1e04c91f86e05c1b..8edadf3a335beba434f09f8195faaabbceffe3fd 100644 (file)
@@ -17,6 +17,7 @@
    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 "event-top.h"
 #include "symtab.h"
 #include "objfiles.h"
 #include "psymtab.h"
index 934ba3f8281d5b48c66a6ea98dc7a5cb364b5ee2..bdb3c22b69234e07462cb8e4b29a3f0fa6e6eddd 100644 (file)
@@ -19,6 +19,7 @@
 
 /* See the GDB User Guide for details of the GDB remote protocol.  */
 
+#include "event-top.h"
 #include "extract-store-integer.h"
 #include "gdbcmd.h"
 #include "remote.h"
index 5fccefe93a161f1cd4d0c706c685ff6baa304a98..38d7f5b7c0f5ba498897953109a9390e8e4c7cea 100644 (file)
@@ -20,6 +20,7 @@
    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 "event-top.h"
 #include "gdb_bfd.h"
 #include "inferior.h"
 #include "infrun.h"
index 53e7356c451e7a02ec91466dfdfa2c4f5ef30cb2..e7fdc287dbc422f6a13877705f079e77d1712e8a 100644 (file)
@@ -25,6 +25,7 @@
 #include "charset.h"
 #include "cp-support.h"
 #include "demangle.h"
+#include "event-top.h"
 #include "gdbarch.h"
 #include "infcall.h"
 #include "objfiles.h"
index ccf38d2202b6142a5454687bd9efa12f5a23ba2f..81ef942c55f5efc078aa8fd8f6a73225d3043ac8 100644 (file)
@@ -17,6 +17,7 @@
    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 "event-top.h"
 #include "serial.h"
 #include "ser-base.h"
 #include "gdbsupport/event-loop.h"
index f2818eccb34cbd6c3e406a0c2398612ad3d01b0c..9b8a56cadefaa46f6e542b6413cf15e64f7182d1 100644 (file)
@@ -16,6 +16,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "skip.h"
+#include "event-top.h"
 #include "value.h"
 #include "valprint.h"
 #include "ui-out.h"
index b714e4ef6ccec40da1a8892f97ceb64a6eac5769..9b995c7a3abe511269865022289897dee3e9077c 100644 (file)
@@ -23,6 +23,7 @@
 #include "arch-utils.h"
 #include "elf-bfd.h"
 #include "elf/amdgpu.h"
+#include "event-top.h"
 #include "gdbsupport/fileio.h"
 #include "inferior.h"
 #include "observable.h"
index 9c8deaac0210873b4bf6ea64327b6b9fde353904..0eaaf506b3c02c844e4ddb20b81cfb2c24f3e8b6 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "arch-utils.h"
 #include "dwarf2/frame.h"
+#include "event-top.h"
 #include "extract-store-integer.h"
 #include "frame.h"
 #include "frame-base.h"
index 85fe4000f329c67df2d0653088ca948546e8286b..1158519623455b5c9cbaff21f74e3a602b05b4d3 100644 (file)
@@ -25,6 +25,7 @@
    this file.  */
 
 #include "bfd.h"
+#include "event-top.h"
 #include "gdbsupport/gdb_obstack.h"
 #include "symtab.h"
 #include "gdbtypes.h"
index 2922265515d50c5519b6b15420f4072e5f4c4f31..6e9312c0a0d90f53fb01d2dfa488b4059428cbb2 100644 (file)
@@ -17,6 +17,7 @@
    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 "event-top.h"
 #include "extract-store-integer.h"
 #include "value.h"
 #include "symtab.h"
index f80fc5ab196d19831d84c6515fd0a78f054e7727..70435996a8ec161f9d5729ceb4300230ab9e05f8 100644 (file)
@@ -17,6 +17,7 @@
    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 "event-top.h"
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "bfd.h"
index d931b3a694b32382e6536be787b2d8b1f1dfbe4d..63b780bb66ed9f4cf445bcfa4b500f43e67babf7 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "dwarf2/call-site.h"
 #include "symtab.h"
+#include "event-top.h"
 #include "gdbtypes.h"
 #include "gdbcore.h"
 #include "frame.h"
index 1586a043af69a1c72d03ea06a2f634d43f7e8bc3..0c0a94573bb7e35d2a56ec9c587f7bd136f534ac 100644 (file)
@@ -18,6 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "arch-utils.h"
+#include "event-top.h"
 #include "symtab.h"
 #include "frame.h"
 #include "gdbtypes.h"
index eaee85f82b4ea19e6d4a31f7895dce6bf849da5f..01e8d7cb92683a191d8683dc9b538b26dc6c8d57 100644 (file)
@@ -19,6 +19,7 @@
    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 "event-top.h"
 #include "gdbcmd.h"
 #include "tui/tui.h"
 #include "tui/tui-hooks.h"
index 04f2d909cd29a4a040bc043666ad6a67214aa4f6..8d7ef7e3ad02be1df2c8d049e671304c6465040e 100644 (file)
@@ -652,47 +652,6 @@ warning_filename_and_errno (const char *filename, int saved_errno)
           safe_strerror (saved_errno));
 }
 
-/* Control C eventually causes this to be called, at a convenient time.  */
-
-void
-quit (void)
-{
-  if (sync_quit_force_run)
-    {
-      sync_quit_force_run = false;
-      throw_forced_quit ("SIGTERM");
-    }
-
-#ifdef __MSDOS__
-  /* No steenking SIGINT will ever be coming our way when the
-     program is resumed.  Don't lie.  */
-  throw_quit ("Quit");
-#else
-  if (job_control
-      /* If there is no terminal switching for this target, then we can't
-        possibly get screwed by the lack of job control.  */
-      || !target_supports_terminal_ours ())
-    throw_quit ("Quit");
-  else
-    throw_quit ("Quit (expect signal SIGINT when the program is resumed)");
-#endif
-}
-
-/* See defs.h.  */
-
-void
-maybe_quit (void)
-{
-  if (!is_main_thread ())
-    return;
-
-  if (sync_quit_force_run)
-    quit ();
-
-  quit_handler ();
-}
-
-\f
 /* Called when a memory allocation fails, with the number of bytes of
    memory requested in SIZE.  */
 
index f9b54a5d9a938f5cd5e3587f8e3014ef97c5ae9b..8eae7cf799535747dd16c8a7d5f35676947da7b6 100644 (file)
@@ -17,6 +17,7 @@
    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 "event-top.h"
 #include "extract-store-integer.h"
 #include "symtab.h"
 #include "gdbtypes.h"
index 13e80c06c9f778f78cd99f616e7bdde40ed3242c..21265ada2ddb8deeb590101c3708693949e7ca79 100644 (file)
@@ -17,6 +17,7 @@
    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 "event-top.h"
 #include "extract-store-integer.h"
 #include "symtab.h"
 #include "gdbtypes.h"
index c4914bdcbaf01ba76d3f6dce33238d84e6ea6115..639dd5b8adc16f6c7b8c7dd4b48c7424a888bf4d 100644 (file)
@@ -19,6 +19,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "bfd.h"
+#include "event-top.h"
 
 #include <sys/types.h>
 #include <fcntl.h>