Make gdb_flush also flush the wrap buffer
[deliverable/binutils-gdb.git] / gdb / event-loop.c
index 4b3ddb84276d95afcaa8e6e90788541b66fe7e50..5be050df39357e442008313e1c9463779254e0c6 100644 (file)
@@ -1,5 +1,5 @@
 /* Event loop machinery for GDB, the GNU debugger.
-   Copyright (C) 1999-2017 Free Software Foundation, Inc.
+   Copyright (C) 1999-2020 Free Software Foundation, Inc.
    Written by Elena Zannoni <ezannoni@cygnus.com> of Cygnus Solutions.
 
    This file is part of GDB.
@@ -20,7 +20,6 @@
 #include "defs.h"
 #include "event-loop.h"
 #include "event-top.h"
-#include "queue.h"
 #include "ser-event.h"
 
 #ifdef HAVE_POLL
@@ -32,9 +31,9 @@
 #endif
 
 #include <sys/types.h>
-#include "gdb_sys_time.h"
+#include "gdbsupport/gdb_sys_time.h"
 #include "gdb_select.h"
-#include "observer.h"
+#include "observable.h"
 #include "top.h"
 
 /* Tell create_file_handler what events we are interested in.
@@ -366,11 +365,11 @@ start_event_loop (void)
     {
       int result = 0;
 
-      TRY
+      try
        {
          result = gdb_do_one_event ();
        }
-      CATCH (ex, RETURN_MASK_ALL)
+      catch (const gdb_exception &ex)
        {
          exception_print (gdb_stderr, ex);
 
@@ -382,7 +381,7 @@ start_event_loop (void)
             get around to resetting the prompt, which leaves readline
             in a messed-up state.  Reset it here.  */
          current_ui->prompt_state = PROMPT_NEEDED;
-         observer_notify_command_error ();
+         gdb::observers::command_error.notify ();
          /* This call looks bizarre, but it is required.  If the user
             entered a command that caused an error,
             after_char_processing_hook won't be called from
@@ -394,7 +393,6 @@ start_event_loop (void)
          /* Maybe better to set a flag to be checked somewhere as to
             whether display the prompt or not.  */
        }
-      END_CATCH
 
       if (result < 0)
        break;
@@ -749,8 +747,8 @@ gdb_wait_for_event (int block)
   int num_found = 0;
 
   /* Make sure all output is done before getting another event.  */
-  gdb_flush (gdb_stdout);
-  gdb_flush (gdb_stderr);
+  ui_file_flush (gdb_stdout);
+  ui_file_flush (gdb_stderr);
 
   if (gdb_notifier.num_fds == 0)
     return -1;
@@ -1270,7 +1268,7 @@ poll_timers (void)
       /* Delete the timer before calling the callback, not after, in
         case the callback itself decides to try deleting the timer
         too.  */
-      xfree (timer_ptr);
+      delete timer_ptr;
 
       /* Call the procedure associated with that timer.  */
       (proc) (client_data);
This page took 0.042781 seconds and 4 git commands to generate.