Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [pushed 2/6] [gdb/testsuite] Cleanup "Attaching to program" regexps
Date: Fri,  6 Nov 2026 23:34:46 +0100	[thread overview]
Message-ID: <20261106223450.1554600-3-tdevries@suse.de> (raw)
In-Reply-To: <20261106223450.1554600-1-tdevries@suse.de>

There's a bunch of regexps in some test-cases that check for
"Attaching to program.*`?$escapedbinfile'?".

Drop the optional `' quotes.

While we're at it, make the check a bit more strict by
replacing "Attaching to program.*" with "Attaching to program: ".
---
 gdb/testsuite/gdb.base/solib-overlap.exp                     | 4 ++--
 gdb/testsuite/gdb.threads/attach-into-signal.exp             | 4 ++--
 gdb/testsuite/gdb.threads/attach-stopped.exp                 | 2 +-
 gdb/testsuite/gdb.threads/main-thread-exit-during-detach.exp | 3 ++-
 4 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/gdb/testsuite/gdb.base/solib-overlap.exp b/gdb/testsuite/gdb.base/solib-overlap.exp
index a94b1f9f6bd..1262f53c415 100644
--- a/gdb/testsuite/gdb.base/solib-overlap.exp
+++ b/gdb/testsuite/gdb.base/solib-overlap.exp
@@ -99,10 +99,10 @@ foreach prelink_lib1 {0x40000000 0x50000000} { with_test_prefix "$prelink_lib1"
 
     set test attach
     gdb_test_multiple "attach $testpid" $test {
-	-re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" {
+	-re -wrap "Attaching to program: $escapedbinfile, process $testpid.*" {
 	    pass $test
 	}
-	-re -wrap "[subst_vars {Attaching to program.*`?$escapedbinfile\.exe'?, process $testpid.*\[Switching to thread $testpid\..*\].*}]" {
+	-re -wrap "[subst_vars {Attaching to program: $escapedbinfile\.exe, process $testpid.*\[Switching to thread $testpid\..*\].*}]" {
 	    # Response expected on Cygwin
 	    pass $test
 	}
diff --git a/gdb/testsuite/gdb.threads/attach-into-signal.exp b/gdb/testsuite/gdb.threads/attach-into-signal.exp
index 2f682ebb073..9dbb675efb6 100644
--- a/gdb/testsuite/gdb.threads/attach-into-signal.exp
+++ b/gdb/testsuite/gdb.threads/attach-into-signal.exp
@@ -54,13 +54,13 @@ proc corefunc { threadtype executable } {
 	while { $passes < 3 && $attempt <= $attempts } {
 	    set test "attach (pass $passes), pending signal catch"
 	    if {[gdb_test_multiple "attach $testpid" $test {
-		-re "Attaching to program.*`?$escapedbinfile'?, process $testpid.* received signal SIGALRM.*$gdb_prompt $" {
+		-re -wrap "Attaching to program: $escapedbinfile, process $testpid.* received signal SIGALRM.*" {
 		    # nonthreaded:
 		    pass $test
 		    verbose -log "$test succeeded on the attempt # $attempt of $attempts"
 		    set passes [expr {$passes + 1}]
 		}
-		-re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" {
+		-re -wrap "Attaching to program: $escapedbinfile, process $testpid.*" {
 		    set ok 0
 
 		    if { $threadtype == "threaded" } {
diff --git a/gdb/testsuite/gdb.threads/attach-stopped.exp b/gdb/testsuite/gdb.threads/attach-stopped.exp
index 2f84c6d77f2..cc60f5bbfb5 100644
--- a/gdb/testsuite/gdb.threads/attach-stopped.exp
+++ b/gdb/testsuite/gdb.threads/attach-stopped.exp
@@ -49,7 +49,7 @@ proc corefunc { threadtype } {
 
     set test "$threadtype: attach2 to stopped, after setting file"
     gdb_test_multiple "attach $testpid" "$test" {
-	-re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" {
+	-re -wrap "Attaching to program: $escapedbinfile, process $testpid.*" {
 	    pass "$test"
 	}
     }
diff --git a/gdb/testsuite/gdb.threads/main-thread-exit-during-detach.exp b/gdb/testsuite/gdb.threads/main-thread-exit-during-detach.exp
index 717eca236c0..65f1a1d981d 100644
--- a/gdb/testsuite/gdb.threads/main-thread-exit-during-detach.exp
+++ b/gdb/testsuite/gdb.threads/main-thread-exit-during-detach.exp
@@ -71,7 +71,8 @@ proc run_test { spawn_inferior } {
 
 	set escapedbinfile  [string_to_regexp $::binfile]
 	gdb_test -no-prompt-anchor "attach $testpid" \
-	    "Attaching to program.*`?$escapedbinfile'?, process $testpid.*" \
+	    [subst_vars \
+		 {Attaching to program: $escapedbinfile, process $testpid.*}] \
 	    "attach to the inferior"
 
 	# Attaching to a multi-threaded application in non-stop mode
-- 
2.51.0


  parent reply	other threads:[~2026-11-06 22:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06 22:34 [pushed 0/6] [gdb/testsuite] Some testsuite fixes Tom de Vries
2026-11-06 22:34 ` [pushed 1/6] [gdb/testsuite] Fix regexp in gdb.base/solib-overlap.exp Tom de Vries
2026-11-06 22:34 ` Tom de Vries [this message]
2026-11-06 22:34 ` [pushed 3/6] [gdb/testsuite] Update regexp in gdb.base/default.exp Tom de Vries
2026-11-06 22:34 ` [pushed 4/6] [gdb/testsuite] Update "Interpreter unrecognized" regexp Tom de Vries
2026-11-06 22:34 ` [pushed 5/6] [gdb/testsuite] Reformat gdb.cp/classes.exp Tom de Vries
2026-11-06 22:34 ` [pushed 6/6] [gdb/testsuite] Update "error in expression, near" regexp Tom de Vries

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=20261106223450.1554600-3-tdevries@suse.de \
    --to=tdevries@suse.de \
    --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