This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH/obvious?] Restore signal handler on remote_wait_as if GDB gets a notification


Hi,

I was discussing something else with Pedro yesterday and he noticed that
remote_wait_as is not restoring the signal handler when "GDB gets a
notification...".  This patch is simple enough so that it could be
treated as obvious, but I decided to consult it either way.

No regressions on Fedora 17 x86_64.

OK to apply?

-- 
Sergio

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.

diff --git a/gdb/remote.c b/gdb/remote.c
index d8854ae..aa2ca87 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -5935,13 +5935,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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]