]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Remove superfluous definition of valnum_re in gdb.base/commands.exp
authorTom de Vries <tdevries@suse.de>
Mon, 2 Feb 2026 20:36:48 +0000 (21:36 +0100)
committerTom de Vries <tdevries@suse.de>
Mon, 2 Feb 2026 20:36:48 +0000 (21:36 +0100)
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.

Approved-by: Kevin Buettner <kevinb@redhat.com>
gdb/testsuite/gdb.base/commands.exp
gdb/testsuite/lib/gdb.exp

index 2c6709f7ec5a11aaa3fc80943c429f9fdadcdc14..9d46e5b029d5953c253f635b4e7f422942ad1198 100644 (file)
@@ -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 \
index c98e3e979db8a01075ac4dbd32af417cc73656b9..0a66da6d54366f865d1ec799cbe2c8d8f0f5822e 100644 (file)
@@ -339,7 +339,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.