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 3/3] [gdb/testsuite] Modernize gdb.base/attach-non-pgrp-leader.exp
Date: Mon, 23 Nov 2026 14:03:48 +0100	[thread overview]
Message-ID: <20261123130348.767273-4-tdevries@suse.de> (raw)
In-Reply-To: <20261123130348.767273-1-tdevries@suse.de>

Modernize test-case gdb.base/attach-non-pgrp-leader.exp:
- use multi_line and subst_vars
- use :: prefix instead of global
---
 gdb/testsuite/gdb.base/attach-non-pgrp-leader.exp | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/gdb/testsuite/gdb.base/attach-non-pgrp-leader.exp b/gdb/testsuite/gdb.base/attach-non-pgrp-leader.exp
index ded09db5d13..897679c37b9 100644
--- a/gdb/testsuite/gdb.base/attach-non-pgrp-leader.exp
+++ b/gdb/testsuite/gdb.base/attach-non-pgrp-leader.exp
@@ -27,10 +27,7 @@ if { [build_executable ${testfile}.exp ${testfile} $srcfile {debug}] == -1 } {
 }
 
 proc do_test {} {
-    global binfile
-    global decimal
-
-    set test_spawn_id [spawn_wait_for_attach $binfile]
+    set test_spawn_id [spawn_wait_for_attach $::binfile]
     set parent_pid [spawn_id_get_pid $test_spawn_id]
 
     # Attach to the parent, run it to a known point, extract the
@@ -51,7 +48,9 @@ proc do_test {} {
 	}
 
 	gdb_test "detach" \
-	    "Detaching from program: .*process $parent_pid\r\n\\\[Inferior $decimal \\(.*\\) detached\\\]"
+	    [multi_line \
+		 "Detaching from program: .*process $parent_pid" \
+		 [subst_vars {\[Inferior $::decimal \(.*\) detached\]}]]
     }
 
     # Start over, and attach to the child this time.
@@ -66,7 +65,9 @@ proc do_test {} {
 	gdb_continue_to_breakpoint "marker"
 
 	gdb_test "detach" \
-	    "Detaching from program: .*process $child_pid\r\n\\\[Inferior $decimal \\(.*\\) detached\\\]"
+	    [multi_line \
+		 "Detaching from program: .*process $child_pid" \
+		 [subst_vars {\[Inferior $::decimal \(.*\) detached\]}]]
     }
 
     kill_wait_spawned_process $test_spawn_id
-- 
2.51.0


      parent reply	other threads:[~2026-11-23 13:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 13:03 [pushed 0/3] [gdb/testsuite] Modernize two test-cases Tom de Vries
2026-11-23 13:03 ` [pushed 1/3] [gdb/testsuite] Rename variable in test-case gdb.base/attach-twice.exp Tom de Vries
2026-11-23 13:03 ` [pushed 2/3] [gdb/testsuite] Modernize gdb.base/attach-twice.exp Tom de Vries
2026-11-23 13:03 ` Tom de Vries [this message]

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=20261123130348.767273-4-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