public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Patrick Palka <patrick@parcs.ath.cx>
Subject: [PATCH 5/8] Fix gdb's selftest.exp after readline import
Date: Tue, 06 Aug 2019 20:43:00 -0000	[thread overview]
Message-ID: <20190806204334.13441-6-tom@tromey.com> (raw)
In-Reply-To: <20190806204334.13441-1-tom@tromey.com>

From: Patrick Palka <patrick@parcs.ath.cx>

After the sync there is one testsuite regression, the test
"signal SIGINT" in gdb.gdb/selftest.exp which now FAILs.  Previously,
the readline 6.2 SIGINT handler would temporarily reinstall the
underlying application's SIGINT handler and immediately re-raise SIGINT
so that the orginal handler gets invoked.  But now (since readline 6.3)
its SIGINT handler does not re-raise SIGINT or directly invoke the
original handler; it now sets a flag marking that SIGINT was raised, and
waits until readline explicitly has control to call the application's
SIGINT handler.  Anyway, because SIGINT is no longer re-raised from
within readline's SIGINT handler, doing "signal SIGINT" with a stopped
inferior gdb process will no longer resume and then immediately stop the
process (since there is no 2nd SIGINT to immediately catch).  Instead,
the inferior gdb process will now just print "Quit" and continue to run.
So with this commit, this particular test case is adjusted to reflect
this change in behavior (we now have to send a 2nd SIGINT manually to
stop it).

gdb/testsuite/ChangeLog
2015-07-25  Patrick Palka  <patrick@parcs.ath.cx>

	* gdb.gdb/selftest.exp (test_with_self): Update test to now
	expect the GDB inferior to no longer immediately stop after
	being resumed with "signal SIGINT".
---
 gdb/testsuite/ChangeLog            |  6 ++++++
 gdb/testsuite/gdb.gdb/selftest.exp | 23 ++++++++++++++++++++---
 2 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp
index 7fdb3b226e1..9651561fafe 100644
--- a/gdb/testsuite/gdb.gdb/selftest.exp
+++ b/gdb/testsuite/gdb.gdb/selftest.exp
@@ -110,9 +110,26 @@ proc test_with_self { } {
     }
     
     set description "send SIGINT signal to child process"
-    gdb_test "signal SIGINT" \
-	"Continuing with signal SIGINT.*" \
-	"$description"
+    gdb_test_multiple "signal SIGINT" "$description" {
+	-re "^signal SIGINT\r\nContinuing with signal SIGINT.\r\nQuit\r\n.* $" {
+	    pass "$description"
+	}
+    }
+
+    set description "send ^C to child process again"
+    send_gdb "\003"
+    gdb_expect {
+	-re "Program received signal SIGINT.*$gdb_prompt $" {
+	    pass "$description"
+	}
+	-re ".*$gdb_prompt $" {
+	    fail "$description"
+	}
+	timeout {
+	    fail "$description (timeout)"
+	}
+    }
+
 
     # Switch back to the GDB thread if Guile support is linked in.
     # "signal SIGINT" could also switch the current thread.
-- 
2.17.2

  parent reply	other threads:[~2019-08-06 20:43 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-06 20:43 [PATCH 0/8] Upgrade readline Tom Tromey
2019-08-06 20:43 ` [PATCH 3/8] Remove gdb workaround from readline/emacs_keymap.c Tom Tromey
2019-08-06 20:43 ` [PATCH 7/8] Remove readline hack from gdb_select Tom Tromey
2019-08-07 14:29   ` Pedro Alves
2019-08-07 22:03     ` Tom Tromey
2019-08-07 22:16       ` Christian Biesinger via gdb-patches
2019-08-06 20:43 ` Tom Tromey [this message]
2019-08-13 17:02   ` [committed][gdb/testsuite] Fix gdb.gdb/selftest.exp regexp Tom de Vries
2019-08-06 20:43 ` [PATCH 2/8] Remove gdb workaround from readline/complete.c Tom Tromey
2019-08-06 20:43 ` [PATCH 8/8] Require readline 7 or newer Tom Tromey
2019-08-07  2:27   ` Eli Zaretskii
2019-08-07 14:42   ` Pedro Alves
2019-08-07 22:31     ` Tom Tromey
2019-08-08  2:37       ` Eli Zaretskii
2019-08-08 11:26       ` Pedro Alves
2019-08-08 11:29       ` Pedro Alves
2019-08-08 20:38         ` Tom Tromey
2019-08-07 14:45   ` Pedro Alves
2019-08-06 20:43 ` [PATCH 4/8] Remove gdb workaround from readline/xfree.c Tom Tromey
2019-08-07  3:05 ` [PATCH 0/8] Upgrade readline Kevin Buettner
2019-08-07 13:38   ` Tom Tromey
2019-08-07 13:40   ` Tom Tromey
2019-08-14 10:21     ` Tom de Vries
2019-08-15 13:46       ` Tom Tromey
2019-08-19 16:38         ` Tom de Vries
2019-08-07 16:32 ` Sergio Durigan Junior
2019-08-07 19:31   ` Tom Tromey
2019-08-12 19:46     ` Sergio Durigan Junior
2019-08-12 19:52       ` Christian Biesinger via gdb-patches
2019-08-12 16:57 ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190806204334.13441-6-tom@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=patrick@parcs.ath.cx \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).