Remove IRIX 5 <sys/proc.h> _KMEMUSER workaround
[deliverable/binutils-gdb.git] / gdb / extension.c
index d2c5669e0eda5f0cae68607aa937a8a918e53c80..c9f5664806ba0b7bfbb20dff2662795b8e0b875d 100644 (file)
@@ -497,7 +497,7 @@ free_ext_lang_type_printers (struct ext_lang_type_printers *printers)
 
 int
 apply_ext_lang_val_pretty_printer (struct type *type, const gdb_byte *valaddr,
-                                  int embedded_offset, CORE_ADDR address,
+                                  LONGEST embedded_offset, CORE_ADDR address,
                                   struct ui_file *stream, int recurse,
                                   const struct value *val,
                                   const struct value_print_options *options,
@@ -774,8 +774,6 @@ set_active_ext_lang (const struct extension_language_defn *now_active)
 void
 restore_active_ext_lang (struct active_ext_lang_state *previous)
 {
-  const struct extension_language_defn *current = active_ext_lang;
-
   active_ext_lang = previous->ext_lang;
 
   if (target_terminal_is_ours ())
@@ -794,25 +792,6 @@ restore_active_ext_lang (struct active_ext_lang_state *previous)
   xfree (previous);
 }
 
-/* Clear the quit flag.
-   The flag is cleared in all extension languages,
-   not just the currently active one.  */
-
-void
-clear_quit_flag (void)
-{
-  int i;
-  const struct extension_language_defn *extlang;
-
-  ALL_ENABLED_EXTENSION_LANGUAGES (i, extlang)
-    {
-      if (extlang->ops->clear_quit_flag != NULL)
-       extlang->ops->clear_quit_flag (extlang);
-    }
-
-  quit_flag = 0;
-}
-
 /* 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
@@ -828,7 +807,16 @@ set_quit_flag (void)
       && active_ext_lang->ops->set_quit_flag != NULL)
     active_ext_lang->ops->set_quit_flag (active_ext_lang);
   else
-    quit_flag = 1;
+    {
+      quit_flag = 1;
+
+      /* Now wake up the event loop, or any interruptible_select.  Do
+        this after setting the flag, because signals on Windows
+        actually run on a separate thread, and thus otherwise the
+        main code could be woken up and find quit_flag still
+        clear.  */
+      quit_serial_event_set ();
+    }
 }
 
 /* Return true if the quit flag has been set, false otherwise.
@@ -852,6 +840,10 @@ check_quit_flag (void)
   /* This is written in a particular way to avoid races.  */
   if (quit_flag)
     {
+      /* No longer need to wake up the event loop or any
+        interruptible_select.  The caller handles the quit
+        request.  */
+      quit_serial_event_clear ();
       quit_flag = 0;
       result = 1;
     }
This page took 0.024368 seconds and 4 git commands to generate.