Remove tui_make_all_visible
[deliverable/binutils-gdb.git] / gdb / exec.c
index 1c3c16c053e9e7bc78bfeb1c9a930cd96bbd9793..3098fcaadd5c5ca5e8819d8ccbfcc57ec4a5765a 100644 (file)
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-
-/* Standard C includes.  */
-#include <ctype.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-
-/* Standard C++ includes.  */
-#include <algorithm>
-
-/* Local non-gdb includes.  */
-#include "arch-utils.h"
-#include "common/pathstuff.h"
-#include "completer.h"
-#include "exec.h"
-#include "filenames.h"
 #include "frame.h"
-#include "gcore.h"
-#include "gdb_bfd.h"
-#include "gdbcmd.h"
-#include "gdbcore.h"
-#include "gdbthread.h"
 #include "inferior.h"
+#include "target.h"
+#include "gdbcmd.h"
 #include "language.h"
+#include "filenames.h"
+#include "symfile.h"
 #include "objfiles.h"
+#include "completer.h"
+#include "value.h"
+#include "exec.h"
 #include "observable.h"
+#include "arch-utils.h"
+#include "gdbthread.h"
 #include "progspace.h"
+#include "gdb_bfd.h"
+#include "gcore.h"
+#include "source.h"
+
+#include <fcntl.h>
 #include "readline/readline.h"
+#include "gdbcore.h"
+
+#include <ctype.h>
+#include <sys/stat.h>
 #include "solist.h"
-#include "source.h"
-#include "symfile.h"
-#include "target.h"
-#include "value.h"
+#include <algorithm>
+#include "gdbsupport/pathstuff.h"
 
 void (*deprecated_file_changed_hook) (const char *);
 
@@ -152,7 +148,7 @@ void
 try_open_exec_file (const char *exec_file_host, struct inferior *inf,
                    symfile_add_flags add_flags)
 {
-  struct gdb_exception prev_err = exception_none;
+  struct gdb_exception prev_err;
 
   /* exec_file_attach and symbol_file_add_main may throw an error if the file
      cannot be opened either locally or remotely.
@@ -165,41 +161,31 @@ try_open_exec_file (const char *exec_file_host, struct inferior *inf,
      Even without a symbol file, the remote-based debugging session should
      continue normally instead of ending abruptly.  Hence we catch thrown
      errors/exceptions in the following code.  */
-  std::string saved_message;
-  TRY
+  try
     {
       /* We must do this step even if exec_file_host is NULL, so that
         exec_file_attach will clear state.  */
       exec_file_attach (exec_file_host, add_flags & SYMFILE_VERBOSE);
     }
-  CATCH (err, RETURN_MASK_ERROR)
+  catch (gdb_exception_error &err)
     {
       if (err.message != NULL)
-       warning ("%s", err.message);
-
-      prev_err = err;
+       warning ("%s", err.what ());
 
-      /* Save message so it doesn't get trashed by the catch below.  */
-      if (err.message != NULL)
-       {
-         saved_message = err.message;
-         prev_err.message = saved_message.c_str ();
-       }
+      prev_err = std::move (err);
     }
-  END_CATCH
 
   if (exec_file_host != NULL)
     {
-      TRY
+      try
        {
          symbol_file_add_main (exec_file_host, add_flags);
        }
-      CATCH (err, RETURN_MASK_ERROR)
+      catch (const gdb_exception_error &err)
        {
          if (!exception_print_same (prev_err, err))
-           warning ("%s", err.message);
+           warning ("%s", err.what ());
        }
-      END_CATCH
     }
 }
 
This page took 0.029632 seconds and 4 git commands to generate.