From: Sergio Durigan Junior Date: Tue, 4 Jun 2013 15:12:52 +0000 (+0000) Subject: GDB was not restoring the signal handler before returning when a notification X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5e1b953b8c0c8bad6c73e144776d859273e31a77;p=binutils-gdb.git GDB was not restoring the signal handler before returning when a notification was received. This patch fixes it. 2013-06-04 Sergio Durigan Junior Pedro Alves * remote.c (remote_wait_as): Restore signal handler before returning when GDB gets a notification. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b01d65adb62..7a0926faac4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2013-06-04 Sergio Durigan Junior + + * remote.c (remote_wait_as): Restore signal handler before returning + when GDB gets a notification. + 2013-06-04 Gary Benson * breakpoint.h (handle_solib_event): Moved function declaration diff --git a/gdb/remote.c b/gdb/remote.c index 7d98bc1432e..24d10f26cc0 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -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;