Regenerate spu overlay and icache manager files
[deliverable/binutils-gdb.git] / gdb / main.c
index d2e3d5e5be7dc7e123db2d2a88951655d92b4f25..accd92781728c25e7a9fb2ba2a6eee216874b29b 100644 (file)
@@ -23,8 +23,6 @@
 #include "inferior.h"
 #include "symfile.h"
 #include "gdbcore.h"
-
-#include "exceptions.h"
 #include "getopt.h"
 
 #include <sys/types.h>
@@ -45,6 +43,7 @@
 #include "filestuff.h"
 #include <signal.h>
 #include "event-top.h"
+#include "infrun.h"
 
 /* The selected interpreter.  This will be used as a set command
    variable, so it should always be malloc'ed - since
@@ -369,7 +368,11 @@ catch_command_errors (catch_command_errors_ftype *command,
 
   TRY_CATCH (e, mask)
     {
+      int was_sync = sync_execution;
+
       command (arg, from_tty);
+
+      maybe_wait_sync_command_done (was_sync);
     }
   return handle_command_errors (e);
 }
@@ -388,7 +391,11 @@ catch_command_errors_const (catch_command_errors_const_ftype *command,
 
   TRY_CATCH (e, mask)
     {
+      int was_sync = sync_execution;
+
       command (arg, from_tty);
+
+      maybe_wait_sync_command_done (was_sync);
     }
   return handle_command_errors (e);
 }
@@ -517,14 +524,12 @@ captured_main (void *data)
   gdb_program_name = xstrdup (argv[0]);
 #endif
 
+  /* Prefix warning messages with the command name.  */
+  warning_pre_print = xstrprintf ("%s: warning: ", gdb_program_name);
+
   if (! getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)))
-    /* Don't use *_filtered or warning() (which relies on
-       current_target) until after initialize_all_files().  */
-    fprintf_unfiltered (gdb_stderr,
-                       _("%s: warning: error finding "
-                         "working directory: %s\n"),
-                        argv[0], safe_strerror (errno));
-    
+    perror_warning_with_name (_("error finding working directory"));
+
   current_directory = gdb_dirbuf;
 
   /* Set the sysroot path.  */
@@ -807,13 +812,8 @@ captured_main (void *data)
 
              i = strtol (optarg, &p, 0);
              if (i == 0 && p == optarg)
-
-               /* Don't use *_filtered or warning() (which relies on
-                  current_target) until after initialize_all_files().  */
-
-               fprintf_unfiltered
-                 (gdb_stderr,
-                  _("warning: could not set baud rate to `%s'.\n"), optarg);
+               warning (_("could not set baud rate to `%s'."),
+                        optarg);
              else
                baud_rate = i;
            }
@@ -825,13 +825,8 @@ captured_main (void *data)
 
              i = strtol (optarg, &p, 0);
              if (i == 0 && p == optarg)
-
-               /* Don't use *_filtered or warning() (which relies on
-                  current_target) until after initialize_all_files().  */
-
-               fprintf_unfiltered (gdb_stderr,
-                                   _("warning: could not set "
-                                     "timeout limit to `%s'.\n"), optarg);
+               warning (_("could not set timeout limit to `%s'."),
+                        optarg);
              else
                remote_timeout = i;
            }
@@ -985,6 +980,7 @@ captured_main (void *data)
     }
 
   /* Set off error and warning messages with a blank line.  */
+  xfree (warning_pre_print);
   warning_pre_print = _("\nwarning: ");
 
   /* Read and execute the system-wide gdbinit file, if it exists.
This page took 0.027079 seconds and 4 git commands to generate.