[committed,gdb/testsuite] Fix gdb.gdb/selftest.exp regexp

Message ID b1dd41f8-020f-cd73-659d-ff27e582d80e@suse.de
State New, archived
Headers

Commit Message

Tom de Vries Aug. 13, 2019, 5:02 p.m. UTC
  [ was Re: [PATCH 5/8] Fix gdb's selftest.exp after readline import ]

On 06-08-19 22:43, Tom Tromey wrote:
> From: Patrick Palka <patrick@parcs.ath.cx>
> 
> +    gdb_expect {
> +	-re "Program received signal SIGINT.*$gdb_prompt $" {
> +	    pass "$description"
> +	}

I've fixed this regexp to also accept "Thread" instead of "Program".

Thanks,
- Tom
  

Patch

[gdb/testsuite] Fix gdb.gdb/selftest.exp regexp

With gdb.gdb/selftest.exp, we get:
...
(xgdb) PASS: gdb.gdb/selftest.exp: send SIGINT signal to child process
^M
Thread 1 "xgdb" received signal SIGINT, Interrupt.^M
0x00007ffff5bf01db in poll () from /lib64/libc.so.6^M
(gdb) FAIL: gdb.gdb/selftest.exp: send ^C to child process again
...

The failure is due to gdb printing 'Thread 1 "xgdb" received signal SIGINT',
but the regexp in the test-case expecting 'Program received signal SIGINT'.

Fix this by updating the regexp, similar to how that is done earlier in the
test-case.

gdb/testsuite/ChangeLog:

2019-08-13  Tom de Vries  <tdevries@suse.de>

	* gdb.gdb/selftest.exp (send ^C to child process again): Accept also
	Thread.

---
 gdb/testsuite/gdb.gdb/selftest.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp
index 9651561faf..2f481ec404 100644
--- a/gdb/testsuite/gdb.gdb/selftest.exp
+++ b/gdb/testsuite/gdb.gdb/selftest.exp
@@ -119,7 +119,7 @@  proc test_with_self { } {
     set description "send ^C to child process again"
     send_gdb "\003"
     gdb_expect {
-	-re "Program received signal SIGINT.*$gdb_prompt $" {
+	-re "(Thread .*|Program) received signal SIGINT.*$gdb_prompt $" {
 	    pass "$description"
 	}
 	-re ".*$gdb_prompt $" {