Patchwork [0/8] Upgrade readline

login
register
mail settings
Submitter Tom Tromey
Date Aug. 7, 2019, 1:38 p.m.
Message ID <87d0hh8596.fsf@tromey.com>
Download mbox | patch
Permalink /patch/33989/
State New
Headers show

Comments

Tom Tromey - Aug. 7, 2019, 1:38 p.m.
>>>>> "Kevin" == Kevin Buettner <kevinb@redhat.com> writes:

Kevin> I glanced at patches 2-5, and 8.  For some reason, 1 and 6 haven't
Kevin> shown up yet.  The ones I've looked at look reasonable.

I think patch 1 is probably too big.

Patch 6 was rejected by the MTA since I didn't write it & so it had the
wrong "From".

I'm appending patch 6 here, and I'll try to send patch 1 compressed.

Otherwise the easiest way is to fetch from my github.  The branch is
"submit/readline-upgrade".

Tom

commit 6d6a1c51e46421b05ebb8e3596f85e6e5c952785
Author: Patrick Palka <patrick@parcs.ath.cx>
Date:   Sun Mar 17 08:32:16 2019 -0600

    Fix gdb's selftest.exp after readline import
    
    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".

Patch

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 49783ebac31..202bc9fb0e3 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@ 
+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".
+
 2019-08-06  Tom Tromey  <tom@tromey.com>
 
 	* gdb.base/style.exp: Add disassemble test.
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.