gdb: include gdbsupport/buildargv.h in ser-mingw.c
[binutils-gdb.git] / gdb / exceptions.c
index 587988ac803f501d4c8d89b2228a9cf4d7ea15b8..87a8dc26a5141876eff68cf1751bda1fd977ae98 100644 (file)
@@ -1,6 +1,6 @@
 /* Exception (throw catch) mechanism, for GDB, the GNU debugger.
 
-   Copyright (C) 1986-2020 Free Software Foundation, Inc.
+   Copyright (C) 1986-2022 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -39,11 +39,7 @@ print_flush (void)
     deprecated_error_begin_hook ();
 
   gdb::optional<target_terminal::scoped_restore_terminal_state> term_state;
-  /* While normally there's always something pushed on the target
-     stack, the NULL check is needed here because we can get here very
-     early during startup, before the target stack is first
-     initialized.  */
-  if (current_top_target () != NULL && target_supports_terminal_ours ())
+  if (target_supports_terminal_ours ())
     {
       term_state.emplace ();
       target_terminal::ours_for_output ();
@@ -89,7 +85,7 @@ print_exception (struct ui_file *file, const struct gdb_exception &e)
       else
        {
          end++;
-         ui_file_write (file, start, end - start);
+         file->write (start, end - start);
        }
     }                                      
   fprintf_filtered (file, "\n");
@@ -137,17 +133,3 @@ exception_fprintf (struct ui_file *file, const struct gdb_exception &e,
       print_exception (file, e);
     }
 }
-
-/* See exceptions.h.  */
-
-int
-exception_print_same (const struct gdb_exception &e1,
-                     const struct gdb_exception &e2)
-{
-  const char *msg1 = e1.message == nullptr ? "" : e1.what ();
-  const char *msg2 = e2.message == nullptr ? "" : e2.what ();
-
-  return (e1.reason == e2.reason
-         && e1.error == e2.error
-         && strcmp (msg1, msg2) == 0);
-}