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: [PATCH 1/5] [gdb/testsuite] Remove superfluous definition of valnum_re in gdb.base/commands.exp
Date: Wed, 28 Jan 2026 13:06:22 +0100	[thread overview]
Message-ID: <20260128120626.1032047-2-tdevries@suse.de> (raw)
In-Reply-To: <20260128120626.1032047-1-tdevries@suse.de>

Regexp valnum_re is defined in lib/gdb.exp.

Remove the superfluous definition of valnum_re in gdb.base/commands.exp.

While we're at it, redefine valnum_re using subst_vars to reduce escaping.
---
 gdb/testsuite/gdb.base/commands.exp | 3 ---
 gdb/testsuite/lib/gdb.exp           | 2 +-
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/gdb/testsuite/gdb.base/commands.exp b/gdb/testsuite/gdb.base/commands.exp
index 2c6709f7ec5..9d46e5b029d 100644
--- a/gdb/testsuite/gdb.base/commands.exp
+++ b/gdb/testsuite/gdb.base/commands.exp
@@ -362,9 +362,6 @@ proc_with_prefix user_defined_command_test {} {
 	"" \
 	"enter commands"
 
-    global decimal
-    set valnum_re "\\\$$decimal"
-
     gdb_test \
 	{mycommand $foo} \
 	[multi_line \
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 23fe3b3424a..acef1ad6310 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -338,7 +338,7 @@ set tdlabel_re "(process|Thread|LWP)"
 
 # A regular expression that matches a value history number.
 # E.g., $1, $2, etc.
-set valnum_re "\\\$$decimal"
+set valnum_re [subst_vars {\$$decimal}]
 
 # A regular expression that matches a breakpoint hit with a breakpoint
 # having several code locations.
-- 
2.51.0


  reply	other threads:[~2026-01-28 12:07 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 ` Tom de Vries [this message]
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 ` [PATCH 5/5] [gdb/testsuite] Use valnum_re more often (part 4) Tom de Vries
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-2-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