Make reinsert_breakpoint thread specific
[deliverable/binutils-gdb.git] / gdb / utils.c
index 6c2d1d48240b6149f8cc7eef8b2f45d9d3daaa28..c70e99cea4924a3dc5093b3d340db29a03b85784 100644 (file)
@@ -109,19 +109,6 @@ static int debug_timestamp = 0;
 
 int job_control;
 
-/* Nonzero means quit immediately if Control-C is typed now, rather
-   than waiting until QUIT is executed.  Be careful in setting this;
-   code which executes with immediate_quit set has to be very careful
-   about being able to deal with being interrupted at any time.  It is
-   almost always better to use QUIT; the only exception I can think of
-   is being able to quit out of a system call (using EINTR loses if
-   the SIGINT happens between the previous QUIT and the system call).
-   To immediately quit in the case in which a SIGINT happens between
-   the previous QUIT and setting immediate_quit (desirable anytime we
-   expect to block), call QUIT after setting immediate_quit.  */
-
-int immediate_quit;
-
 /* Nonzero means that strings with character values >0x7F should be printed
    as octal escapes.  Zero means just print the value (e.g. it's an
    international character, and the terminal or window can cope.)  */
@@ -1060,10 +1047,12 @@ print_sys_errmsg (const char *string, int errcode)
 void
 quit (void)
 {
+  struct ui *ui = current_ui;
+
   if (sync_quit_force_run)
     {
       sync_quit_force_run = 0;
-      quit_force (NULL, stdin == instream);
+      quit_force (NULL, 0);
     }
 
 #ifdef __MSDOS__
@@ -1086,11 +1075,13 @@ quit (void)
 void
 maybe_quit (void)
 {
-  if (check_quit_flag () || sync_quit_force_run)
+  if (sync_quit_force_run)
     quit ();
+
+  quit_handler ();
+
   if (deprecated_interactive_hook)
     deprecated_interactive_hook ();
-  target_check_pending_interrupt ();
 }
 
 \f
@@ -1280,7 +1271,8 @@ defaulted_query (const char *ctlstr, const char defchar, va_list args)
      question we're asking, and then answer the default automatically.  This
      way, important error messages don't get lost when talking to GDB
      over a pipe.  */
-  if (! input_from_terminal_p ())
+  if (current_ui->instream != current_ui->stdin_stream
+      || !input_interactive_p (current_ui))
     {
       target_terminal_ours_for_output ();
       wrap_here ("");
@@ -1318,6 +1310,7 @@ defaulted_query (const char *ctlstr, const char defchar, va_list args)
 
   /* We'll need to handle input.  */
   target_terminal_ours ();
+  make_cleanup_override_quit_handler (default_quit_handler);
 
   while (1)
     {
@@ -1892,6 +1885,7 @@ prompt_for_continue (void)
   /* We'll need to handle input.  */
   make_cleanup_restore_target_terminal ();
   target_terminal_ours ();
+  make_cleanup_override_quit_handler (default_quit_handler);
 
   /* Call gdb_readline_wrapper, not readline, in order to keep an
      event loop running.  */
This page took 0.026628 seconds and 4 git commands to generate.