GDB was not restoring the signal handler before returning when a notification
authorSergio Durigan Junior <sergiodj@redhat.com>
Tue, 4 Jun 2013 15:12:52 +0000 (15:12 +0000)
committerSergio Durigan Junior <sergiodj@redhat.com>
Tue, 4 Jun 2013 15:12:52 +0000 (15:12 +0000)
was received.  This patch fixes it.

2013-06-04  Sergio Durigan Junior  <sergiodj@redhat.com>
    Pedro Alves  <palves@redhat.com>

* remote.c (remote_wait_as): Restore signal handler before returning
when GDB gets a notification.

gdb/ChangeLog
gdb/remote.c

index b01d65adb624843371fd851585059602195058ab..7a0926faac4fc44619fb7a8a79bf1fbb4b967ea6 100644 (file)
@@ -1,3 +1,8 @@
+2013-06-04  Sergio Durigan Junior  <sergiodj@redhat.com>
+
+       * remote.c (remote_wait_as): Restore signal handler before returning
+       when GDB gets a notification.
+
 2013-06-04  Gary Benson  <gbenson@redhat.com>
 
        * breakpoint.h (handle_solib_event): Moved function declaration
index 7d98bc1432e546f177c9e068258e31ad412f5389..24d10f26cc0334b3ea7f7f05959dfa665b0a9b36 100644 (file)
@@ -5951,13 +5951,13 @@ remote_wait_as (ptid_t ptid, struct target_waitstatus *status, int options)
       ret = getpkt_or_notif_sane (&rs->buf, &rs->buf_size,
                                  wait_forever_enabled_p, &is_notif);
 
+      if (!target_is_async_p ())
+       signal (SIGINT, ofunc);
+
       /* GDB gets a notification.  Return to core as this event is
         not interesting.  */
       if (ret != -1 && is_notif)
        return minus_one_ptid;
-
-      if (!target_is_async_p ())
-       signal (SIGINT, ofunc);
     }
 
   buf = rs->buf;