From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH 5/5] [gdb/testsuite] Use valnum_re more often (part 4)
Date: Wed, 28 Jan 2026 13:06:26 +0100 [thread overview]
Message-ID: <20260128120626.1032047-6-tdevries@suse.de> (raw)
In-Reply-To: <20260128120626.1032047-1-tdevries@suse.de>
Grepping through the testsuite I also found:
- "\\$\[0-9\]\+"
- "\\$\[0-9\]\*"
- "\\$\[0-9\]".
Also replace these with valnum_re.
---
gdb/testsuite/gdb.base/bitfields.exp | 12 ++++++------
gdb/testsuite/gdb.cp/m-data.exp | 6 +++---
gdb/testsuite/gdb.objc/basicclass.exp | 10 +++++-----
3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/gdb/testsuite/gdb.base/bitfields.exp b/gdb/testsuite/gdb.base/bitfields.exp
index a5928ab2daf..6f4ace22371 100644
--- a/gdb/testsuite/gdb.base/bitfields.exp
+++ b/gdb/testsuite/gdb.base/bitfields.exp
@@ -193,12 +193,12 @@ proc bitfield_internalvar {} {
gdb_test_no_output "set \$myvar.f = 1"
# Here comes the true testing.
- gdb_test "print \$myvar.a" "\\$\[0-9\]\+ = 0"
- gdb_test "print \$myvar.inner.b" "\\$\[0-9\]\+ = 1"
- gdb_test "print \$myvar.inner.deep.c" "\\$\[0-9\]\+ = 0"
- gdb_test "print \$myvar.inner.deep.d" "\\$\[0-9\]\+ = -1"
- gdb_test "print \$myvar.inner.e" "\\$\[0-9\]\+ = -1"
- gdb_test "print \$myvar.f" "\\$\[0-9\]\+ = -1"
+ gdb_test "print \$myvar.a" "${::valnum_re} = 0"
+ gdb_test "print \$myvar.inner.b" "${::valnum_re} = 1"
+ gdb_test "print \$myvar.inner.deep.c" "${::valnum_re} = 0"
+ gdb_test "print \$myvar.inner.deep.d" "${::valnum_re} = -1"
+ gdb_test "print \$myvar.inner.e" "${::valnum_re} = -1"
+ gdb_test "print \$myvar.f" "${::valnum_re} = -1"
}
gdb_test_no_output "set print sevenbit-strings"
diff --git a/gdb/testsuite/gdb.cp/m-data.exp b/gdb/testsuite/gdb.cp/m-data.exp
index 7b67d78d55b..1d1c94e107d 100644
--- a/gdb/testsuite/gdb.cp/m-data.exp
+++ b/gdb/testsuite/gdb.cp/m-data.exp
@@ -85,14 +85,14 @@ gdb_test "print test3.data.key2" "${::valnum_re} = 7" "template object, long"
gdb_test "print test3.data.value" "${::valnum_re} = oriental" "template object, base enum"
# template object, derived template data member's enum
-gdb_test "print test3.data.value_derived" "\\$\[0-9]\* = etruscan" "template object, derived enum"
+gdb_test "print test3.data.value_derived" "${::valnum_re} = etruscan" "template object, derived enum"
# Now some tests for shadowing (see PR gdb/804):
gdb_breakpoint "C::marker"
gdb_continue_to_breakpoint "continue to shadow breakpoint"
-gdb_test "print shadow" "\\$\[0-9]\* = 1" "shadowing member"
-gdb_test "print ::shadow" "\\$\[0-9]\* = 0" "shadowed global variable"
+gdb_test "print shadow" "${::valnum_re} = 1" "shadowing member"
+gdb_test "print ::shadow" "${::valnum_re} = 0" "shadowed global variable"
gdb_exit
diff --git a/gdb/testsuite/gdb.objc/basicclass.exp b/gdb/testsuite/gdb.objc/basicclass.exp
index 79ac09dbb4d..903583274e4 100644
--- a/gdb/testsuite/gdb.objc/basicclass.exp
+++ b/gdb/testsuite/gdb.objc/basicclass.exp
@@ -124,15 +124,15 @@ gdb_test continue \
# Test printing objects
#
gdb_test "print object" \
- "\\$\[0-9\] = .*0x0" \
+ "${::valnum_re} = .*0x0" \
" print an ivar of self"
gdb_test "print self" \
- "\\$\[0-9\] = \\(.*BasicClass \\*\\) 0x\[0-9a-f\]+" \
+ "${::valnum_re} = \\(.*BasicClass \\*\\) 0x\[0-9a-f\]+" \
" print self"
gdb_test "print \*self" \
- "\\$\[0-9\] = \{{?isa = 0x\[0-9a-f\]+( <.*>)?}?, object = 0x0\}" \
+ "${::valnum_re} = \{{?isa = 0x\[0-9a-f\]+( <.*>)?}?, object = 0x0\}" \
" print contents of self"
#
@@ -154,11 +154,11 @@ gdb_test continue \
# Test calling Objective-C methods
#
gdb_test "print \[self printHi\]" \
- "Hi.*\\$\[0-9\] = \\(.*objc_object \\*\\) 0x\[0-9a-f\]+" \
+ "Hi.*${::valnum_re} = \\(.*objc_object \\*\\) 0x\[0-9a-f\]+" \
"call an Objective-C method with no arguments"
gdb_test "print \[self printNumber: 42\]" \
- "42.*\\$\[0-9\] = 43" \
+ "42.*${::valnum_re} = 43" \
"call an Objective-C method with one argument"
#
--
2.51.0
next prev parent reply other threads:[~2026-01-28 12:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-28 12:06 [PATCH 0/5] [gdb/testsuite] Use valnum_re more often Tom de Vries
2026-01-28 12:06 ` [PATCH 1/5] [gdb/testsuite] Remove superfluous definition of valnum_re in gdb.base/commands.exp Tom de Vries
2026-01-28 12:06 ` [PATCH 2/5] [gdb/testsuite] Use valnum_re more often (part 1) Tom de Vries
2026-01-28 12:06 ` [PATCH 3/5] [gdb/testsuite] Use valnum_re more often (part 2) Tom de Vries
2026-01-28 12:06 ` [PATCH 4/5] [gdb/testsuite] Use valnum_re more often (part 3) Tom de Vries
2026-01-28 12:06 ` Tom de Vries [this message]
2026-02-02 17:05 ` [PATCH 0/5] [gdb/testsuite] Use valnum_re more often Kevin Buettner
2026-02-03 11:14 ` 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=20260128120626.1032047-6-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