* remote-sim.c (gdbsim_open): Use "--architecture" instead of
[binutils-gdb.git] / gdb / remote-sim.c
index 816e9cc6bc23d27c08412fd58a7eb2d62d5a98f0..a1a1e32bc2c6ddd9d29da7a54d2709d6d54dc51c 100644 (file)
@@ -506,7 +506,7 @@ gdbsim_open (args, from_tty)
 
   len = (7 + 1 /* gdbsim */
         + strlen (" -E little")
-        + strlen (" --arch=xxxxxxxxxx")
+        + strlen (" --architecture=xxxxxxxxxx")
         + (args ? strlen (args) : 0)
         + 50) /* slack */;
   arg_buf = (char *) alloca (len);
@@ -533,7 +533,7 @@ gdbsim_open (args, from_tty)
      explicitly specified */
   if (!target_architecture_auto)
     {
-      strcat (arg_buf, " --arch=");
+      strcat (arg_buf, " --architecture=");
       strcat (arg_buf, target_architecture->printable_name);
     }
   /* finally, any explicit args */
@@ -672,7 +672,8 @@ gdb_os_poll_quit (p)
    just as `wait' would. */
 
 static void
-gdbsim_cntrl_c (int signo)
+gdbsim_cntrl_c (signo)
+     int signo;
 {
   gdbsim_stop ();
 }
@@ -689,7 +690,18 @@ gdbsim_wait (pid, status)
   if (sr_get_debug ())
     printf_filtered ("gdbsim_wait\n");
 
+#if defined (HAVE_SIGACTION) && defined (SA_RESTART)
+  {
+    struct sigaction sa, osa;
+    sa.sa_handler = gdbsim_cntrl_c;
+    sigemptyset (&sa.sa_mask);
+    sa.sa_flags = 0;
+    sigaction (SIGINT, &sa, &osa);
+    prev_sigint = osa.sa_handler;
+  }
+#else
   prev_sigint = signal (SIGINT, gdbsim_cntrl_c);
+#endif
   sim_resume (gdbsim_desc, resume_step,
              target_signal_to_host (resume_siggnal));
   signal (SIGINT, prev_sigint);