]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: move declarations of check_quit_flag and set_quit_flag to extension.h
authorSimon Marchi <simon.marchi@polymtl.ca>
Tue, 23 Apr 2024 13:22:56 +0000 (09:22 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Tue, 23 Apr 2024 15:26:14 +0000 (11:26 -0400)
Move them out of defs.h, to extension.h, since the implementations are
in extension.c.

Change-Id: Ie7321468bd7fecc684d70b09f72c3ee8ac75d8f4
Approved-By: Tom Tromey <tom@tromey.com>
gdb/defs.h
gdb/extension.c
gdb/extension.h

index 91724d30195fdd84bea44251accf699445ed575e..6f9c0d1f781a6f7974557f93383fa98f523ac5c5 100644 (file)
@@ -94,25 +94,6 @@ extern std::string python_libdir;
 /* * Search path for separate debug files.  */
 extern std::string debug_file_directory;
 
-/* GDB's SIGINT handler basically sets a flag; code that might take a
-   long time before it gets back to the event loop, and which ought to
-   be interruptible, checks this flag using the QUIT macro, which, if
-   GDB has the terminal, throws a quit exception.
-
-   In addition to setting a flag, the SIGINT handler also marks a
-   select/poll-able file descriptor as read-ready.  That is used by
-   interruptible_select in order to support interrupting blocking I/O
-   in a race-free manner.
-
-   These functions use the extension_language_ops API to allow extension
-   language(s) and GDB SIGINT handling to coexist seamlessly.  */
-
-/* * Evaluate to non-zero if the quit flag is set, zero otherwise.  This
-   will clear the quit flag as a side effect.  */
-extern int check_quit_flag (void);
-/* * Set the quit flag.  */
-extern void set_quit_flag (void);
-
 /* 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
index f4bdcc1f6110f744078c12431487d8c75a379a35..2d692d054315fa9be0e4b5528a3935203d6cd597 100644 (file)
@@ -863,16 +863,10 @@ restore_active_ext_lang (struct active_ext_lang_state *previous)
   xfree (previous);
 }
 
-/* Set the quit flag.
-   This only sets the flag in the currently active extension language.
-   If the currently active extension language does not have cooperative
-   SIGINT handling, then GDB's global flag is set, and it is up to the
-   extension language to call check_quit_flag.  The extension language
-   is free to install its own SIGINT handler, but we still need to handle
-   the transition.  */
+/* See extension.h.  */
 
 void
-set_quit_flag (void)
+set_quit_flag ()
 {
 #if CXX_STD_THREAD
   std::lock_guard guard (ext_lang_mutex);
@@ -894,13 +888,10 @@ set_quit_flag (void)
     }
 }
 
-/* Return true if the quit flag has been set, false otherwise.
-   Note: The flag is cleared as a side-effect.
-   The flag is checked in all extension languages that support cooperative
-   SIGINT handling, not just the current one.  This simplifies transitions.  */
+/* See extension.h.  */
 
 int
-check_quit_flag (void)
+check_quit_flag ()
 {
 #if CXX_STD_THREAD
   std::lock_guard guard (ext_lang_mutex);
index 9ba1299f95e109f5eb5f33449bc0252e001d8cbd..94a500d745860735ecb0ce05a3234020cc43a555 100644 (file)
@@ -429,4 +429,34 @@ private:
   bool m_prev_cooperative_sigint_handling_disabled;
 };
 
+/* GDB's SIGINT handler basically sets a flag; code that might take a
+   long time before it gets back to the event loop, and which ought to
+   be interruptible, checks this flag using the QUIT macro, which, if
+   GDB has the terminal, throws a quit exception.
+
+   In addition to setting a flag, the SIGINT handler also marks a
+   select/poll-able file descriptor as read-ready.  That is used by
+   interruptible_select in order to support interrupting blocking I/O
+   in a race-free manner.
+
+   These functions use the extension_language_ops API to allow extension
+   language(s) and GDB SIGINT handling to coexist seamlessly.  */
+
+/* Return true if the quit flag has been set, false otherwise.
+   Note: The flag is cleared as a side-effect.
+   The flag is checked in all extension languages that support cooperative
+   SIGINT handling, not just the current one.  This simplifies transitions.  */
+
+extern int check_quit_flag ();
+
+/* Set the quit flag.
+   This only sets the flag in the currently active extension language.
+   If the currently active extension language does not have cooperative
+   SIGINT handling, then GDB's global flag is set, and it is up to the
+   extension language to call check_quit_flag.  The extension language
+   is free to install its own SIGINT handler, but we still need to handle
+   the transition.  */
+
+extern void set_quit_flag ();
+
 #endif /* EXTENSION_H */