Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 5/6] Fix racy output matching in gdb.base/multi-attach.exp, gdb.server/ext-{attach, restart, ext-run}.exp
Date: Thu, 26 Oct 2017 17:42:00 -0000	[thread overview]
Message-ID: <1509039747-15026-6-git-send-email-palves@redhat.com> (raw)
In-Reply-To: <1509039747-15026-1-git-send-email-palves@redhat.com>

This commit fixes this same problem in several places:

  (gdb) PASS: gdb.multi/multi-attach.exp: backtrace 2
  kill
  Kill the program being debugged? (y or n) y
  (gdb) FAIL: gdb.multi/multi-attach.exp: kill inferior 2 (got interactive prompt)

This is just another case of the gdb_test_multiple's internal "got
interactive prompt" pattern matching because the testcase misses
matching enough.

gdb/testsuite/ChangeLog:
yyyy-mm-dd  Pedro Alves  <palves@redhat.com>

	* gdb.multi/multi-attach.exp ("kill" test): Match the whole query
	output.
	* gdb.server/ext-attach.exp ("kill" test): Likewise.
	* gdb.server/ext-restart.exp ("kill" test): Likewise.
	* gdb.server/ext-run.exp ("kill" test): Likewise.
	* gdb.server/ext-wrapper.exp ("kill" test): Likewise.
---
 gdb/testsuite/gdb.multi/multi-attach.exp | 4 ++--
 gdb/testsuite/gdb.server/ext-attach.exp  | 2 +-
 gdb/testsuite/gdb.server/ext-restart.exp | 2 +-
 gdb/testsuite/gdb.server/ext-run.exp     | 2 +-
 gdb/testsuite/gdb.server/ext-wrapper.exp | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gdb/testsuite/gdb.multi/multi-attach.exp b/gdb/testsuite/gdb.multi/multi-attach.exp
index 4240ff7..9397f85 100644
--- a/gdb/testsuite/gdb.multi/multi-attach.exp
+++ b/gdb/testsuite/gdb.multi/multi-attach.exp
@@ -51,9 +51,9 @@ gdb_test "attach $testpid2" \
     "attach to program 2"
 gdb_test "backtrace" ".*main.*" "backtrace 2"
 
-gdb_test "kill" "" "kill inferior 2" "Kill the program being debugged.*" "y"
+gdb_test "kill" "" "kill inferior 2" "Kill the program being debugged. .y or n. " "y"
 gdb_test "inferior 1" ".*Switching to inferior 1.*"
-gdb_test "kill" "" "kill inferior 1" "Kill the program being debugged.*" "y"
+gdb_test "kill" "" "kill inferior 1" "Kill the program being debugged. .y or n. " "y"
 
 kill_wait_spawned_process $test_spawn_id1
 kill_wait_spawned_process $test_spawn_id2
diff --git a/gdb/testsuite/gdb.server/ext-attach.exp b/gdb/testsuite/gdb.server/ext-attach.exp
index f3e992a..881c636 100644
--- a/gdb/testsuite/gdb.server/ext-attach.exp
+++ b/gdb/testsuite/gdb.server/ext-attach.exp
@@ -68,7 +68,7 @@ gdb_test "attach $testpid" \
     "attach to remote program 2"
 gdb_test "backtrace" ".*main.*" "backtrace 2"
 
-gdb_test "kill" "" "kill" "Kill the program being debugged.*" "y"
+gdb_test "kill" "" "kill" "Kill the program being debugged. .y or n. " "y"
 gdb_test_no_output "monitor exit"
 
 kill_wait_spawned_process $test_spawn_id
diff --git a/gdb/testsuite/gdb.server/ext-restart.exp b/gdb/testsuite/gdb.server/ext-restart.exp
index 44c9b1f..d28ce47 100644
--- a/gdb/testsuite/gdb.server/ext-restart.exp
+++ b/gdb/testsuite/gdb.server/ext-restart.exp
@@ -60,6 +60,6 @@ with_test_prefix "restart" {
     }
 }
 
-gdb_test "kill" "" "kill" "Kill the program being debugged.*" "y"
+gdb_test "kill" "" "kill" "Kill the program being debugged. .y or n. " "y"
 
 gdb_test_no_output "monitor exit"
diff --git a/gdb/testsuite/gdb.server/ext-run.exp b/gdb/testsuite/gdb.server/ext-run.exp
index cdb1695..d8b3e92 100644
--- a/gdb/testsuite/gdb.server/ext-run.exp
+++ b/gdb/testsuite/gdb.server/ext-run.exp
@@ -61,7 +61,7 @@ if { [istarget *-*-linux*] } {
     }
 }
 
-gdb_test "kill" "" "kill" "Kill the program being debugged.*" "y"
+gdb_test "kill" "" "kill" "Kill the program being debugged. .y or n. " "y"
 
 gdb_load $binfile
 gdb_test "monitor help" "The following monitor commands.*" \
diff --git a/gdb/testsuite/gdb.server/ext-wrapper.exp b/gdb/testsuite/gdb.server/ext-wrapper.exp
index 8b1af7b..b195ae7 100644
--- a/gdb/testsuite/gdb.server/ext-wrapper.exp
+++ b/gdb/testsuite/gdb.server/ext-wrapper.exp
@@ -65,6 +65,6 @@ with_test_prefix "restart" {
     gdb_test "print d" "\\$${decimal} = ${hex} \"1\".*"
 }
 
-gdb_test "kill" "" "kill" "Kill the program being debugged.*" "y"
+gdb_test "kill" "" "kill" "Kill the program being debugged. .y or n. " "y"
 
 gdb_test_no_output "monitor exit"
-- 
2.5.5


  parent reply	other threads:[~2017-10-26 17:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-26 17:42 [PATCH 0/6] Fix several cases of racy output matching Pedro Alves
2017-10-26 17:42 ` [PATCH 4/6] Fix racy output matching in gdb.base/cpcompletion.exp Pedro Alves
2017-10-26 17:42 ` Pedro Alves [this message]
2017-10-26 17:42 ` [PATCH 1/6] Fix racy output matching in gdb.asm/asm-source.exp Pedro Alves
2017-10-26 17:42 ` [PATCH 6/6] Fix racy output matching in gdb.tui/tui-completion.exp Pedro Alves
2017-11-15 16:09   ` Simon Marchi
2017-11-15 16:16     ` Pedro Alves
2017-10-26 17:42 ` [PATCH 3/6] Fix racy output matching in gdb.base/memattr.exp Pedro Alves
2017-10-26 17:42 ` [PATCH 2/6] Fix racy output matching in gdb.base/completion.exp Pedro Alves
2017-11-09 22:50 ` [PATCH 0/6] Fix several cases of racy output matching Pedro Alves

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=1509039747-15026-6-git-send-email-palves@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /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