Make sure terminal settings are restored before exiting
[deliverable/binutils-gdb.git] / gdb / inf-loop.c
index d4f9a356f19f5faf5d31803e14aca3f239780c19..eed881d5144e6a9a8538689c8576b70ed7a21570 100644 (file)
@@ -1,5 +1,5 @@
 /* Handling of inferior events for the event loop for GDB, the GNU debugger.
-   Copyright (C) 1999-2014 Free Software Foundation, Inc.
+   Copyright (C) 1999-2015 Free Software Foundation, Inc.
    Written by Elena Zannoni <ezannoni@cygnus.com> of Cygnus Solutions.
 
    This file is part of GDB.
@@ -25,7 +25,6 @@
 #include "event-top.h"
 #include "inf-loop.h"
 #include "remote.h"
-#include "exceptions.h"
 #include "language.h"
 #include "gdbthread.h"
 #include "continuations.h"
@@ -51,13 +50,12 @@ inferior_event_handler (enum inferior_event_type event_type,
         error status.  If an error occurs while getting an event from
         the target, just cancel the current command.  */
       {
-       volatile struct gdb_exception ex;
 
-       TRY_CATCH (ex, RETURN_MASK_ALL)
+       TRY
          {
            fetch_inferior_event (client_data);
          }
-       if (ex.reason < 0)
+       CATCH (ex, RETURN_MASK_ALL)
          {
            bpstat_clear_actions ();
            do_all_intermediate_continuations (1);
@@ -65,6 +63,7 @@ inferior_event_handler (enum inferior_event_type event_type,
 
            throw_exception (ex);
          }
+       END_CATCH
       }
       break;
 
@@ -75,7 +74,7 @@ inferior_event_handler (enum inferior_event_type event_type,
             so that when the inferior is not running we don't get
             distracted by spurious inferior output.  */
          if (target_has_execution)
-           target_async (NULL, 0);
+           target_async (0);
        }
 
       /* Do all continuations associated with the whole inferior (not
@@ -112,18 +111,21 @@ inferior_event_handler (enum inferior_event_type event_type,
         are only run when the command list is all done.  */
       if (interpreter_async)
        {
-         volatile struct gdb_exception e;
 
          check_frame_language_change ();
 
          /* Don't propagate breakpoint commands errors.  Either we're
             stopping or some command resumes the inferior.  The user will
             be informed.  */
-         TRY_CATCH (e, RETURN_MASK_ALL)
+         TRY
            {
              bpstat_do_actions ();
            }
-         exception_print (gdb_stderr, e);
+         CATCH (e, RETURN_MASK_ALL)
+           {
+             exception_print (gdb_stderr, e);
+           }
+         END_CATCH
        }
       break;
 
This page took 0.031471 seconds and 4 git commands to generate.