Automatic date update in version.in
[deliverable/binutils-gdb.git] / gdb / infcall.c
index 3c33c11d6a335e6d3a4f46e311690b69ea57dcfb..f55acb5c27e27a1a625c1114ee86b499a34de0b9 100644 (file)
@@ -1,6 +1,6 @@
 /* Perform an inferior function call, for GDB, the GNU debugger.
 
-   Copyright (C) 1986-2016 Free Software Foundation, Inc.
+   Copyright (C) 1986-2017 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -519,8 +519,6 @@ call_thread_fsm_should_stop (struct thread_fsm *self,
 
   if (stop_stack_dummy == STOP_STACK_DUMMY)
     {
-      struct cleanup *old_chain;
-
       /* Done.  */
       thread_fsm_set_finished (self);
 
@@ -530,13 +528,9 @@ call_thread_fsm_should_stop (struct thread_fsm *self,
       f->return_value = get_call_return_value (&f->return_meta_info);
 
       /* Break out of wait_sync_command_done.  */
-      old_chain = make_cleanup_restore_current_ui ();
-      current_ui = f->waiting_ui;
+      scoped_restore save_ui = make_scoped_restore (&current_ui, f->waiting_ui);
       target_terminal_ours ();
       f->waiting_ui->prompt_state = PROMPT_NEEDED;
-
-      /* This restores the previous UI.  */
-      do_cleanups (old_chain);
     }
 
   return 1;
@@ -584,6 +578,8 @@ run_inferior_call (struct call_thread_fsm *sm,
      fetch_inferior_event.  */
   current_ui->async = 0;
 
+  delete_file_handler (current_ui->input_fd);
+
   call_thread->control.in_infcall = 1;
 
   clear_proceed_status (0);
@@ -617,6 +613,10 @@ run_inferior_call (struct call_thread_fsm *sm,
      state again here.  In other cases, stdin will be re-enabled by
      inferior_event_handler, when an exception is thrown.  */
   current_ui->prompt_state = saved_prompt_state;
+  if (current_ui->prompt_state == PROMPT_BLOCKED)
+    delete_file_handler (current_ui->input_fd);
+  else
+    ui_register_input_event_handler (current_ui);
   current_ui->async = saved_ui_async;
 
   /* At this point the current thread may have changed.  Refresh
This page took 0.025594 seconds and 4 git commands to generate.