* [PATCH 2/5] [gdb/testsuite] Use valnum_re more often (part 1)
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 ` Tom de Vries
2026-01-28 12:06 ` [PATCH 3/5] [gdb/testsuite] Use valnum_re more often (part 2) Tom de Vries
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Tom de Vries @ 2026-01-28 12:06 UTC (permalink / raw)
To: gdb-patches
Use valnum_re more often. Do this by replacing "\\\$\[0-9\]+" and similar.
I ran these commands handling 6 variants of $decimal:
...
$ find gdb/testsuite/ -type f -name *.exp* \
| xargs sed -i 's/\\\\\\$\\\[0-9\\\]+/${::valnum_re}/g
$ find gdb/testsuite/ -type f -name *.exp* \
| xargs sed -i 's/\\\\\\$\\\[0-9\]+/${::valnum_re}/g'
$ find gdb/testsuite/ -type f -name *.exp* \
| xargs sed -i 's/\\\\\\$$decimal/${::valnum_re}/g'
$ find gdb/testsuite/ -type f -name *.exp* \
| xargs sed -i 's/\\\\\\$$::decimal/${::valnum_re}/g'
$ find gdb/testsuite/ -type f -name *.exp* \
| xargs sed -i 's/\\\\\\$${decimal}/${::valnum_re}/g'
$ find gdb/testsuite/ -type f -name *.exp* \
| xargs sed -i 's/\\\\\\$${::decimal}/${::valnum_re}/g'
...
and then once more matching '\\$' instead of '\\\$'.
---
gdb/testsuite/gdb.ada/array_return.exp | 6 +-
gdb/testsuite/gdb.ada/formatted_ref.exp | 14 +--
gdb/testsuite/gdb.ada/operator_call.exp | 2 +-
gdb/testsuite/gdb.arch/aarch64-gcs-core.exp | 2 +-
gdb/testsuite/gdb.arch/aarch64-mte.exp | 2 +-
.../gdb.arch/amd64-shadow-stack-corefile.exp | 2 +-
gdb/testsuite/gdb.arch/iwmmxt-regs.exp | 12 +-
gdb/testsuite/gdb.arch/mips-fcr.exp | 4 +-
gdb/testsuite/gdb.arch/mips16-thunks.exp | 2 +-
gdb/testsuite/gdb.arch/powerpc-d128-regs.exp | 2 +-
gdb/testsuite/gdb.arch/s390-tdbregs.exp | 6 +-
gdb/testsuite/gdb.base/args.exp | 4 +-
gdb/testsuite/gdb.base/bitshift.exp | 4 +-
.../gdb.base/bp-cmds-sourced-script.exp | 2 +-
gdb/testsuite/gdb.base/charset.exp | 2 +-
gdb/testsuite/gdb.base/code_elim.exp | 2 +-
gdb/testsuite/gdb.base/coredump-filter.exp | 2 +-
gdb/testsuite/gdb.base/corefile.exp | 8 +-
gdb/testsuite/gdb.base/debug-expr.exp | 4 +-
gdb/testsuite/gdb.base/dump.exp | 4 +-
gdb/testsuite/gdb.base/finish.exp | 2 +-
gdb/testsuite/gdb.base/frameapply.exp | 38 +++---
gdb/testsuite/gdb.base/func-ptrs.exp | 6 +-
gdb/testsuite/gdb.base/gnu_vector.exp | 116 +++++++++---------
gdb/testsuite/gdb.base/infnan.exp | 4 +-
gdb/testsuite/gdb.base/interact.exp | 2 +-
.../gdb.base/multi-line-starts-subshell.exp | 2 +-
gdb/testsuite/gdb.base/new-ui.exp | 2 +-
.../gdb.base/non-lazy-array-index.exp | 2 +-
gdb/testsuite/gdb.base/overlays.exp | 2 +-
gdb/testsuite/gdb.base/prologue.exp | 4 +-
gdb/testsuite/gdb.base/ptr-typedef.exp | 4 +-
gdb/testsuite/gdb.base/randomize.exp | 2 +-
gdb/testsuite/gdb.base/range-stepping.exp | 4 +-
gdb/testsuite/gdb.base/relocate.exp | 8 +-
gdb/testsuite/gdb.base/scope.exp | 112 ++++++++---------
gdb/testsuite/gdb.base/set-cwd.exp | 10 +-
.../gdb.base/share-env-with-gdbserver.exp | 6 +-
gdb/testsuite/gdb.base/shell.exp | 4 +-
gdb/testsuite/gdb.base/signals.exp | 2 +-
gdb/testsuite/gdb.base/solib-disc.exp | 8 +-
gdb/testsuite/gdb.base/startup-with-shell.exp | 2 +-
gdb/testsuite/gdb.base/structs3.exp | 2 +-
gdb/testsuite/gdb.base/style.exp | 4 +-
gdb/testsuite/gdb.cp/bs15503.exp | 8 +-
gdb/testsuite/gdb.cp/call-c.exp | 6 +-
gdb/testsuite/gdb.cp/classes.exp | 26 ++--
gdb/testsuite/gdb.cp/converts.exp | 2 +-
gdb/testsuite/gdb.cp/cp-relocate.exp | 2 +-
gdb/testsuite/gdb.cp/ctti.exp | 30 ++---
gdb/testsuite/gdb.cp/derivation.exp | 36 +++---
gdb/testsuite/gdb.cp/formatted-ref.exp | 18 +--
gdb/testsuite/gdb.cp/inherit.exp | 2 +-
gdb/testsuite/gdb.cp/member-ptr.exp | 2 +-
gdb/testsuite/gdb.cp/method-ref-return.exp | 12 +-
gdb/testsuite/gdb.cp/namespace.exp | 2 +-
gdb/testsuite/gdb.cp/overload.exp | 62 +++++-----
gdb/testsuite/gdb.cp/static-print-quit.exp | 2 +-
gdb/testsuite/gdb.cp/virtfunc.exp | 26 ++--
gdb/testsuite/gdb.cp/virtfunc2.exp | 10 +-
gdb/testsuite/gdb.fortran/debug-expr.exp | 6 +-
gdb/testsuite/gdb.fortran/derived-type.exp | 16 +--
gdb/testsuite/gdb.fortran/namelist.exp | 2 +-
gdb/testsuite/gdb.fortran/subarray.exp | 24 ++--
.../gdb.mi/user-selected-context-sync.exp | 2 +-
gdb/testsuite/gdb.multi/tids.exp | 2 +-
.../gdb.opt/clobbered-registers-O2.exp | 4 +-
gdb/testsuite/gdb.opt/inline-cmds.exp | 2 +-
gdb/testsuite/gdb.opt/inline-locals.exp | 4 +-
.../gdb.opt/static-optimized-out.exp | 2 +-
gdb/testsuite/gdb.server/ext-wrapper.exp | 4 +-
gdb/testsuite/gdb.server/inferior-args.exp | 4 +-
gdb/testsuite/gdb.server/wrapper.exp | 2 +-
.../gdb.threads/infcall-thread-announce.exp | 6 +-
gdb/testsuite/gdb.threads/pthreads.exp | 12 +-
.../gdb.threads/reconnect-signal.exp | 4 +-
gdb/testsuite/gdb.threads/schedlock.exp | 2 +-
.../gdb.threads/thread-bp-deleted.exp | 2 +-
gdb/testsuite/gdb.threads/threadapply.exp | 4 +-
gdb/testsuite/gdb.threads/tls-core.exp | 2 +-
gdb/testsuite/gdb.trace/collection.exp | 100 +++++++--------
.../gdb.trace/disconnected-tracing.exp | 14 +--
gdb/testsuite/gdb.trace/report.exp | 4 +-
gdb/testsuite/gdb.trace/stap-trace.exp | 2 +-
.../gdb.trace/unavailable-dwarf-piece.exp | 18 +--
gdb/testsuite/gdb.trace/unavailable.exp | 8 +-
gdb/testsuite/lib/gdb.exp | 4 +-
87 files changed, 468 insertions(+), 468 deletions(-)
diff --git a/gdb/testsuite/gdb.ada/array_return.exp b/gdb/testsuite/gdb.ada/array_return.exp
index 11cd1736c64..dab9bf8a3d4 100644
--- a/gdb/testsuite/gdb.ada/array_return.exp
+++ b/gdb/testsuite/gdb.ada/array_return.exp
@@ -60,7 +60,7 @@ gdb_test "cont" \
"continuing to Create_Small"
gdb_test "finish" \
- "Value returned is \\\$\[0-9\]+ = \\(1, 1\\)" \
+ "Value returned is ${::valnum_re} = \\(1, 1\\)" \
"value printed by finish of Create_Small"
# Now continue until reaching the second breakpoint inside Create_Large,
@@ -79,7 +79,7 @@ if {![istarget "hppa*64*-*-*"]} {
}
gdb_test "finish" \
- "Value returned is \\\$\[0-9\]+ = \\(2, 2, 2, 2\\)" \
+ "Value returned is ${::valnum_re} = \\(2, 2, 2, 2\\)" \
"value printed by finish of Create_Large"
# Now continue until reaching the third breakpoint, and then do another
@@ -90,5 +90,5 @@ gdb_test "cont" \
"continuing to Create_Small_Float_Vector"
gdb_test "finish" \
- "Value returned is \\\$\[0-9\]+ = \\(4.25, 4.25\\)" \
+ "Value returned is ${::valnum_re} = \\(4.25, 4.25\\)" \
"value printed by finish of Create_Small_Float_Vector"
diff --git a/gdb/testsuite/gdb.ada/formatted_ref.exp b/gdb/testsuite/gdb.ada/formatted_ref.exp
index 87efa78f5f1..0051ca95fec 100644
--- a/gdb/testsuite/gdb.ada/formatted_ref.exp
+++ b/gdb/testsuite/gdb.ada/formatted_ref.exp
@@ -40,7 +40,7 @@ proc get_address { var } {
global gdb_prompt
gdb_test_multiple "print $var'access" "address of $var" {
- -re "\\$\[0-9\]+ = \\(.*\\) (0x\[0-9a-f\]+).*$gdb_prompt $" {
+ -re "${::valnum_re} = \\(.*\\) (0x\[0-9a-f\]+).*$gdb_prompt $" {
return $expect_out(1,string)
}
}
@@ -52,13 +52,13 @@ proc test_p_x { var val addr } {
set test "print/x $var"
gdb_test_multiple "$test" $test {
- -re "\\$\[0-9\]+ = [string_to_regexp $val].*$gdb_prompt $" {
+ -re "${::valnum_re} = [string_to_regexp $val].*$gdb_prompt $" {
pass $test
}
- -re "\\$\[0-9\]+ = $addr.*$gdb_prompt $" {
+ -re "${::valnum_re} = $addr.*$gdb_prompt $" {
fail "$test (prints just address)"
}
- -re "\\$\[0-9\]+ = 0x\[a-f0-9\]+.*$gdb_prompt $" {
+ -re "${::valnum_re} = 0x\[a-f0-9\]+.*$gdb_prompt $" {
fail "$test (prints unexpected address)"
}
}
@@ -72,10 +72,10 @@ proc test_p_x_addr { var addr } {
foreach space {"" " "} {
set test "print/x $var'$space$attr"
gdb_test_multiple $test $test {
- -re "\\$\[0-9\]+ = $addr.*$gdb_prompt $" {
+ -re "${::valnum_re} = $addr.*$gdb_prompt $" {
pass $test
}
- -re "\\$\[0-9\]+ = 0x\[a-f0-9+\]+.*$gdb_prompt $" {
+ -re "${::valnum_re} = 0x\[a-f0-9+\]+.*$gdb_prompt $" {
fail "$test (prints unexpected address)"
}
}
@@ -91,7 +91,7 @@ proc test_p_x_addr { var addr } {
proc test_p_op1_equals_op2 {op1 op2} {
set test "print $op1 = $op2"
- gdb_test $test "\\$\[0-9\]+ = true"
+ gdb_test $test "${::valnum_re} = true"
}
clean_restart ${testfile}
diff --git a/gdb/testsuite/gdb.ada/operator_call.exp b/gdb/testsuite/gdb.ada/operator_call.exp
index 24b3ab57240..5eb98f9f834 100644
--- a/gdb/testsuite/gdb.ada/operator_call.exp
+++ b/gdb/testsuite/gdb.ada/operator_call.exp
@@ -64,7 +64,7 @@ proc test_with_menu {command result} {
# The number we just sent, ignore.
exp_continue
}
- -re "\\\$\[0-9\]+ = (\[^\r\n\]+)\r\n" {
+ -re "${::valnum_re} = (\[^\r\n\]+)\r\n" {
if {[regexp $result $expect_out(1,string)]} {
pass $command
} else {
diff --git a/gdb/testsuite/gdb.arch/aarch64-gcs-core.exp b/gdb/testsuite/gdb.arch/aarch64-gcs-core.exp
index d6aefbfb403..30a620ed06b 100644
--- a/gdb/testsuite/gdb.arch/aarch64-gcs-core.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-gcs-core.exp
@@ -52,7 +52,7 @@ proc check_core_file {core_filename saved_gcspr} {
}
# Check the value of GCSPR in the core file.
- gdb_test "print/x \$gcspr" "\\$\[0-9\]+ = $saved_gcspr" \
+ gdb_test "print/x \$gcspr" "${::valnum_re} = $saved_gcspr" \
"gcspr contents from core file"
}
diff --git a/gdb/testsuite/gdb.arch/aarch64-mte.exp b/gdb/testsuite/gdb.arch/aarch64-mte.exp
index 99f1320da38..4da38109573 100644
--- a/gdb/testsuite/gdb.arch/aarch64-mte.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-mte.exp
@@ -292,7 +292,7 @@ with_test_prefix "print command" {
gdb_test "p/x ${tagged_ptr_symbol}" \
[multi_line \
"Logical tag \\(${ltag}\\) does not match the allocation tag \\(0x${atag_hexnz}\\)\." \
- "\\\$\[0-9\]+ = ${untagged_ptr}"] \
+ "${::valnum_re} = ${untagged_ptr}"] \
"show tag mismatch"
}
diff --git a/gdb/testsuite/gdb.arch/amd64-shadow-stack-corefile.exp b/gdb/testsuite/gdb.arch/amd64-shadow-stack-corefile.exp
index 0a8f3959049..754f59b3e04 100644
--- a/gdb/testsuite/gdb.arch/amd64-shadow-stack-corefile.exp
+++ b/gdb/testsuite/gdb.arch/amd64-shadow-stack-corefile.exp
@@ -37,7 +37,7 @@ proc check_core_file {core_filename saved_pl3_ssp} {
}
# Check the value of ssp in the core file.
- gdb_test "print/x \$pl3_ssp" "\\$\[0-9\]+ = $saved_pl3_ssp" \
+ gdb_test "print/x \$pl3_ssp" "${::valnum_re} = $saved_pl3_ssp" \
"pl3_ssp contents from core file"
}
diff --git a/gdb/testsuite/gdb.arch/iwmmxt-regs.exp b/gdb/testsuite/gdb.arch/iwmmxt-regs.exp
index 5e1af998bf5..6c1848593b2 100644
--- a/gdb/testsuite/gdb.arch/iwmmxt-regs.exp
+++ b/gdb/testsuite/gdb.arch/iwmmxt-regs.exp
@@ -55,20 +55,20 @@ for {set i 0} {$i < 4} {incr i 1} {
gdb_test "next" ".*write_regs.*" "next over read_regs"
for {set i 0} {$i < 16} {incr i 1} {
- gdb_test "p \$wR$i.u64 == ((${i}LL << 32) | ${i})" "\\\$$decimal = 1" "test reg wR$i"
+ gdb_test "p \$wR$i.u64 == ((${i}LL << 32) | ${i})" "${::valnum_re} = 1" "test reg wR$i"
}
# Don't test wCSSF.
-gdb_test "p \$wCASF" "\\\$$decimal = 200" "test reg wCASF"
+gdb_test "p \$wCASF" "${::valnum_re} = 200" "test reg wCASF"
for {set i 0} {$i < 4} {incr i 1} {
- gdb_test "p \$wCGR$i == 100 + $i" "\\\$$decimal = 1" "test reg wCGR$i"
+ gdb_test "p \$wCGR$i == 100 + $i" "${::valnum_re} = 1" "test reg wCGR$i"
}
# Also verify the copies read by the target.
for {set i 0} {$i < 16} {incr i 1} {
- gdb_test "p regs\[$i\] == ((${i}LL << 32) | ${i})" "\\\$$decimal = 1" "test stored wR$i"
+ gdb_test "p regs\[$i\] == ((${i}LL << 32) | ${i})" "${::valnum_re} = 1" "test stored wR$i"
}
# Don't test wcssf.
-gdb_test "p control_regs\[1\]" "\\\$$decimal = 200" "test stored wCASF"
+gdb_test "p control_regs\[1\]" "${::valnum_re} = 200" "test stored wCASF"
for {set i 0} {$i < 4} {incr i 1} {
- gdb_test "p control_regs\[$i + 2\] == 100 + $i" "\\\$$decimal = 1" "test stored wCGR$i"
+ gdb_test "p control_regs\[$i + 2\] == 100 + $i" "${::valnum_re} = 1" "test stored wCGR$i"
}
diff --git a/gdb/testsuite/gdb.arch/mips-fcr.exp b/gdb/testsuite/gdb.arch/mips-fcr.exp
index b24f7fe5243..2cb22004946 100644
--- a/gdb/testsuite/gdb.arch/mips-fcr.exp
+++ b/gdb/testsuite/gdb.arch/mips-fcr.exp
@@ -46,6 +46,6 @@ gdb_test_multiple "show mipsfpu" "check for MIPS floating-point coprocessor" {
# Now check that FCRs are accessible and 32-bit wide.
gdb_test "info registers \$fcsr" "fcsr: $hex"
-gdb_test "print sizeof \$fcsr" "\\\$$decimal = 4"
+gdb_test "print sizeof \$fcsr" "${::valnum_re} = 4"
gdb_test "info registers \$fir" "fir: $hex"
-gdb_test "print sizeof \$fir" "\\\$$decimal = 4"
+gdb_test "print sizeof \$fir" "${::valnum_re} = 4"
diff --git a/gdb/testsuite/gdb.arch/mips16-thunks.exp b/gdb/testsuite/gdb.arch/mips16-thunks.exp
index 3ef044890c6..f8d485a08de 100644
--- a/gdb/testsuite/gdb.arch/mips16-thunks.exp
+++ b/gdb/testsuite/gdb.arch/mips16-thunks.exp
@@ -69,7 +69,7 @@ gdb_test_multiple "" "check for MIPS16 support in the processor" {
-re "Breakpoint 1.*inmain .*$gdb_prompt $" {
gdb_test_multiple "finish" \
"check for MIPS16 support in the processor" {
- -re "Value returned is \\\$\[0-9\]+ = 0\[^0-9\].*$gdb_prompt $" {
+ -re "Value returned is ${::valnum_re} = 0\[^0-9\].*$gdb_prompt $" {
verbose "MIPS16 support check successful."
}
-re "$gdb_prompt $" {
diff --git a/gdb/testsuite/gdb.arch/powerpc-d128-regs.exp b/gdb/testsuite/gdb.arch/powerpc-d128-regs.exp
index 1140563d09f..05ae31877e1 100644
--- a/gdb/testsuite/gdb.arch/powerpc-d128-regs.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-d128-regs.exp
@@ -44,7 +44,7 @@ gdb_test "next" ""
for {set i 0} {$i < 16} {incr i 1} {
gdb_test "set \$dl$i=d128" "" "set dl$i register"
-gdb_test "print \$dl$i" "\\\$$decimal = 1\.2345678910" "print dl$i register as DFP"
+gdb_test "print \$dl$i" "${::valnum_re} = 1\.2345678910" "print dl$i register as DFP"
gdb_test "info reg dl$i" \
"dl$i\[ \]*1\.2345678910\[ \t\]*\\(raw 0x2205800000000000000000049c5de09c\\)" \
diff --git a/gdb/testsuite/gdb.arch/s390-tdbregs.exp b/gdb/testsuite/gdb.arch/s390-tdbregs.exp
index be217559a28..1225762a1ab 100644
--- a/gdb/testsuite/gdb.arch/s390-tdbregs.exp
+++ b/gdb/testsuite/gdb.arch/s390-tdbregs.exp
@@ -51,12 +51,12 @@ gdb_test_multiple "next" "check for TE support" {
set crashline [gdb_get_line_number "FAULT"]
-gdb_test "print \$tdb0" "\\\$\[0-9\]+ = <unavailable>" "tdb0 unavailable"
-gdb_test "print \$tr0" "\\\$\[0-9\]+ = <unavailable>" "tr0 unavailable"
+gdb_test "print \$tdb0" "${::valnum_re} = <unavailable>" "tdb0 unavailable"
+gdb_test "print \$tr0" "${::valnum_re} = <unavailable>" "tr0 unavailable"
gdb_test "next" \
"Program received signal SIGSEGV, .*" \
"crash in transaction"
-gdb_test "print/x \$tdb0" "\\\$\[0-9\]+ = 0x1.*" "tdb0 available"
+gdb_test "print/x \$tdb0" "${::valnum_re} = 0x1.*" "tdb0 available"
gdb_test "set print symbol-filename" "" "set print symbol-filename"
gdb_test "print/a \$atia" \
"<crash_in_transaction.*:$crashline>" \
diff --git a/gdb/testsuite/gdb.base/args.exp b/gdb/testsuite/gdb.base/args.exp
index bc52701e38a..bd10c90b6cd 100644
--- a/gdb/testsuite/gdb.base/args.exp
+++ b/gdb/testsuite/gdb.base/args.exp
@@ -117,7 +117,7 @@ proc args_test { name arglist {re_esc_list {}} {re_no_esc_list {}} } {
set expected_len [expr {1 + [llength $re_list]}]
gdb_test "print argc" \
- "\\\$$::decimal = $expected_len" "argc for $name"
+ "${::valnum_re} = $expected_len" "argc for $name"
set i 1
foreach arg $re_list {
@@ -142,7 +142,7 @@ proc args_test { name arglist {re_esc_list {}} {re_no_esc_list {}} } {
}
gdb_test "print argv\[$i\]" \
- "\\\$$::decimal = $::hex \"$arg\"" \
+ "${::valnum_re} = $::hex \"$arg\"" \
"argv\[$i\] for $name"
set i [expr {$i + 1}]
}
diff --git a/gdb/testsuite/gdb.base/bitshift.exp b/gdb/testsuite/gdb.base/bitshift.exp
index 3af6614b26f..4066cf5b2f8 100644
--- a/gdb/testsuite/gdb.base/bitshift.exp
+++ b/gdb/testsuite/gdb.base/bitshift.exp
@@ -34,7 +34,7 @@ proc test_shift {lang cmd result_re {warning_or_error ""}} {
}
} else {
gdb_test_multiple $cmd "" {
- -re -wrap "^\\$$::decimal$result_re" {
+ -re -wrap "^${::valnum_re}$result_re" {
pass $gdb_test_name
}
}
@@ -47,7 +47,7 @@ proc test_shift {lang cmd result_re {warning_or_error ""}} {
}
gdb_test_multiple $cmd "" {
- -re -wrap "^$warning_re\\$$::decimal$result_re" {
+ -re -wrap "^$warning_re${::valnum_re}$result_re" {
pass $gdb_test_name
}
}
diff --git a/gdb/testsuite/gdb.base/bp-cmds-sourced-script.exp b/gdb/testsuite/gdb.base/bp-cmds-sourced-script.exp
index 62c3ac7ed85..e12016f2fc5 100644
--- a/gdb/testsuite/gdb.base/bp-cmds-sourced-script.exp
+++ b/gdb/testsuite/gdb.base/bp-cmds-sourced-script.exp
@@ -31,7 +31,7 @@ gdb_test "source $script_file" \
gdb_run_cmd
gdb_test_multiple "" "commands executed twice" {
- -re "\\$${decimal} = 100123\r\n\\$${decimal} = 100123\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = 100123\r\n${::valnum_re} = 100123\r\n$gdb_prompt $" {
pass $gdb_test_name
}
}
diff --git a/gdb/testsuite/gdb.base/charset.exp b/gdb/testsuite/gdb.base/charset.exp
index e8c225bb438..9148fec57e8 100644
--- a/gdb/testsuite/gdb.base/charset.exp
+++ b/gdb/testsuite/gdb.base/charset.exp
@@ -368,7 +368,7 @@ foreach target_charset $charset_subset {
# gdb_test that requires us to use gdb_expect here.
send_gdb "print $L'\\0'\n"
gdb_expect {
- -re "\\\$${decimal} = 0 $L'\\\\000'\[\r\n\]+$gdb_prompt $" {
+ -re "${::valnum_re} = 0 $L'\\\\000'\[\r\n\]+$gdb_prompt $" {
pass "print the null character in ${target_charset}"
}
-re "$gdb_prompt $" {
diff --git a/gdb/testsuite/gdb.base/code_elim.exp b/gdb/testsuite/gdb.base/code_elim.exp
index cac745ab8a3..86714346201 100644
--- a/gdb/testsuite/gdb.base/code_elim.exp
+++ b/gdb/testsuite/gdb.base/code_elim.exp
@@ -67,7 +67,7 @@ proc test_eliminated_var { var } {
-re "No symbol \"${var}\" in current context\\.\[\r\n\]+${gdb_prompt} $" {
pass "test eliminated var ${var}"
}
- -re "\\\$\[0-9\]+ = \\(.*\\) (0|$hex)( <${var}>)?\[\r\n\]+${gdb_prompt} $" {
+ -re "${::valnum_re} = \\(.*\\) (0|$hex)( <${var}>)?\[\r\n\]+${gdb_prompt} $" {
fail "test eliminated var ${var}"
}
}
diff --git a/gdb/testsuite/gdb.base/coredump-filter.exp b/gdb/testsuite/gdb.base/coredump-filter.exp
index c93c0c48162..c35a0334ff3 100644
--- a/gdb/testsuite/gdb.base/coredump-filter.exp
+++ b/gdb/testsuite/gdb.base/coredump-filter.exp
@@ -62,7 +62,7 @@ proc do_load_and_test_core { core var working_var working_value dump_excluded }
# Access the memory the addresses point to.
if { $dump_excluded == 0 } {
- gdb_test "print/x *(char *) $coredump_var_addr($var)" "\(\\\$$decimal = <error: \)?Cannot access memory at address $hex\(>\)?" \
+ gdb_test "print/x *(char *) $coredump_var_addr($var)" "\(${::valnum_re} = <error: \)?Cannot access memory at address $hex\(>\)?" \
"printing $var when core is loaded (should not work)"
gdb_test "print/x *(char *) $coredump_var_addr($working_var)" " = $working_value.*" \
"print/x *$working_var ( = $working_value)"
diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp
index fcc9b7b284a..957bccf43a4 100644
--- a/gdb/testsuite/gdb.base/corefile.exp
+++ b/gdb/testsuite/gdb.base/corefile.exp
@@ -130,11 +130,11 @@ gdb_test_multiple "core-file $corefile" "core-file command" {
# Test correct mapping of corefile sections by printing some variables.
-gdb_test "print coremaker_data" "\\\$$decimal = 202"
-gdb_test "print coremaker_bss" "\\\$$decimal = 10"
-gdb_test "print coremaker_ro" "\\\$$decimal = 201"
+gdb_test "print coremaker_data" "${::valnum_re} = 202"
+gdb_test "print coremaker_bss" "${::valnum_re} = 10"
+gdb_test "print coremaker_ro" "${::valnum_re} = 201"
-gdb_test "print func2::coremaker_local" "\\\$$decimal = \\{0, 1, 2, 3, 4\\}"
+gdb_test "print func2::coremaker_local" "${::valnum_re} = \\{0, 1, 2, 3, 4\\}"
# Test the presence and the correct values of $_exitsignal and
# $_exitcode variables. The corefile is generated with a SIGABRT,
diff --git a/gdb/testsuite/gdb.base/debug-expr.exp b/gdb/testsuite/gdb.base/debug-expr.exp
index 54389bc8683..80f6d5a968b 100644
--- a/gdb/testsuite/gdb.base/debug-expr.exp
+++ b/gdb/testsuite/gdb.base/debug-expr.exp
@@ -41,10 +41,10 @@ gdb_test_debug_expr "print /x {char\[4\]} array" \
# This caused gdb to output garbage and possibly segfault
gdb_test_debug_expr "print \"hello\"" \
- ".*OP_STRING\[^\r\n\]*.*: ordinary string.*\[\r\n\]\\$$decimal = \"hello\"" \
+ ".*OP_STRING\[^\r\n\]*.*: ordinary string.*\[\r\n\]${::valnum_re} = \"hello\"" \
"string evaluation with debug expr"
# An expression using a function call.
gdb_test_debug_expr "print call_me ( &val )" \
- ".*OP_FUNCALL\[^\r\n\]*.*UNOP_ADDR.*\[\r\n\]\\$$decimal = 0.*" \
+ ".*OP_FUNCALL\[^\r\n\]*.*UNOP_ADDR.*\[\r\n\]${::valnum_re} = 0.*" \
"function call expression"
diff --git a/gdb/testsuite/gdb.base/dump.exp b/gdb/testsuite/gdb.base/dump.exp
index 341e6e55691..427161d4d91 100644
--- a/gdb/testsuite/gdb.base/dump.exp
+++ b/gdb/testsuite/gdb.base/dump.exp
@@ -159,7 +159,7 @@ proc capture_value { expression args } {
set test "capture $expression"
}
gdb_test_multiple "print ${expression}" "$test" {
- -re "\\$\[0-9\]+ = (\[^\r\n\]+).*$gdb_prompt $" {
+ -re "${::valnum_re} = (\[^\r\n\]+).*$gdb_prompt $" {
set output_string "$expect_out(1,string)"
pass "$test"
}
@@ -184,7 +184,7 @@ proc capture_pointer_with_type { pointer } {
set test "capture type of pointer $pointer"
set output_string ""
gdb_test_multiple "p ${pointer}" $test {
- -re "\\$\[0-9\]+ = .*$gdb_prompt $" {
+ -re "${::valnum_re} = .*$gdb_prompt $" {
# Expected output of "p ${pointer}" is like "$7 = (int (*)[32]) 0x804a0e0",
# and we want to extract "(int (*)[32]) 0x804a0e0" from it via
# following regexp.
diff --git a/gdb/testsuite/gdb.base/finish.exp b/gdb/testsuite/gdb.base/finish.exp
index 3c82305086f..43719cb9fc5 100644
--- a/gdb/testsuite/gdb.base/finish.exp
+++ b/gdb/testsuite/gdb.base/finish.exp
@@ -94,7 +94,7 @@ proc finish_no_print {} {
}
gdb_test_no_output "set print finish off"
gdb_test "finish" \
- "Value returned is \\\$$decimal = <not displayed>"
+ "Value returned is ${::valnum_re} = <not displayed>"
gdb_test "print \$" " = 1" \
"Ensure return value was properly saved"
}
diff --git a/gdb/testsuite/gdb.base/frameapply.exp b/gdb/testsuite/gdb.base/frameapply.exp
index 04459031c3d..73650052ad9 100644
--- a/gdb/testsuite/gdb.base/frameapply.exp
+++ b/gdb/testsuite/gdb.base/frameapply.exp
@@ -48,17 +48,17 @@ with_test_prefix "simple command" {
gdb_test $cmd \
[multi_line \
"#0${ws}setup_done ${any}" \
- "\\\$\[0-9]+ = 0x14${any}" \
+ "${::valnum_re} = 0x14${any}" \
"#1${ws}${any} f1 ${any}" \
- "\\\$\[0-9]+ = 0x14${any}" \
+ "${::valnum_re} = 0x14${any}" \
"#2${ws}${any} f2 ${any}" \
- "\\\$\[0-9]+ = 0x14${any}" \
+ "${::valnum_re} = 0x14${any}" \
"#3${ws}${any} f3 ${any}" \
- "\\\$\[0-9]+ = 0x14${any}" \
+ "${::valnum_re} = 0x14${any}" \
"#4${ws}${any} f4 ${any}" \
- "\\\$\[0-9]+ = 0x14${any}" \
+ "${::valnum_re} = 0x14${any}" \
"#5${ws}${any} main ${any}" \
- "\\\$\[0-9]+ = 0x14${any}" \
+ "${::valnum_re} = 0x14${any}" \
] \
"run a simple command on all frames"
}
@@ -73,11 +73,11 @@ with_test_prefix "innermost 3" {
gdb_test $cmd \
[multi_line \
"#0${ws}setup_done ${any}" \
- "\\\$\[0-9]+ = 0x14${any}" \
+ "${::valnum_re} = 0x14${any}" \
"#1${ws}${any} f1 ${any}" \
- "\\\$\[0-9]+ = 0x14${any}" \
+ "${::valnum_re} = 0x14${any}" \
"#2${ws}${any} f2 ${any}" \
- "\\\$\[0-9]+ = 0x14${any}" \
+ "${::valnum_re} = 0x14${any}" \
] \
"run a simple command on the 3 innermost frames"
}
@@ -91,11 +91,11 @@ with_test_prefix "outermost 3" {
gdb_test $cmd \
[multi_line \
"#3${ws}${any} f3 ${any}" \
- "\\\$\[0-9]+ = 0x14${any}" \
+ "${::valnum_re} = 0x14${any}" \
"#4${ws}${any} f4 ${any}" \
- "\\\$\[0-9]+ = 0x14${any}" \
+ "${::valnum_re} = 0x14${any}" \
"#5${ws}${any} main ${any}" \
- "\\\$\[0-9]+ = 0x14${any}" \
+ "${::valnum_re} = 0x14${any}" \
] \
"run a simple command on the 3 outermost frames"
}
@@ -131,7 +131,7 @@ with_test_prefix "cont !silent flags" {
"#2${ws}${any} f2 ${any}" \
"No symbol \\\"f3arg\\\" in current context." \
"#3${ws}${any} f3 ${any}" \
- "\\\$\[0-9]+ = 3${any}" \
+ "${::valnum_re} = 3${any}" \
"#4${ws}${any} f4 ${any}" \
"No symbol \\\"f3arg\\\" in current context." \
"#5${ws}${any} main ${any}" \
@@ -150,7 +150,7 @@ with_test_prefix "!cont silent flags" {
gdb_test $cmd \
[multi_line \
"#3${ws}${any} f3 ${any}" \
- "\\\$\[0-9]+ = 3${any}" \
+ "${::valnum_re} = 3${any}" \
] \
"run a command failing in all frames except #3, -s to silently continue"
}
@@ -165,9 +165,9 @@ with_test_prefix "!quiet flag" {
gdb_test $cmd \
[multi_line \
"#0${ws}setup_done ${any}" \
- "\\\$\[0-9]+ = 0x14${any}" \
+ "${::valnum_re} = 0x14${any}" \
"#1${ws}${any} f1 ${any}" \
- "\\\$\[0-9]+ = 0x14${any}" \
+ "${::valnum_re} = 0x14${any}" \
] \
"run a command, printing location"
}
@@ -180,8 +180,8 @@ with_test_prefix "quiet flag" {
set cmd "frame apply $frame_apply_args p /x 20"
gdb_test $cmd \
[multi_line \
- "\\\$\[0-9]+ = 0x14${any}" \
- "\\\$\[0-9]+ = 0x14${any}" \
+ "${::valnum_re} = 0x14${any}" \
+ "${::valnum_re} = 0x14${any}" \
] \
"run a command with -q quiet flag, printing only command results"
}
@@ -194,7 +194,7 @@ with_test_prefix "quiet silent flags" {
"level 0-5 -q -s -q"} {
set cmd "frame apply $frame_apply_args p f3arg"
gdb_test $cmd \
- "\\\$\[0-9]+ = 3${any}" \
+ "${::valnum_re} = 3${any}" \
"run a command failing in all frames except #3, -s to silently continue, quiet"
}
}
diff --git a/gdb/testsuite/gdb.base/func-ptrs.exp b/gdb/testsuite/gdb.base/func-ptrs.exp
index fc411b8e958..66c3daac7a9 100644
--- a/gdb/testsuite/gdb.base/func-ptrs.exp
+++ b/gdb/testsuite/gdb.base/func-ptrs.exp
@@ -49,7 +49,7 @@ gdb_test "continue" \
# Go back up, make sure the return value is 0.
gdb_test "finish" \
- "Run till exit from #0 +incr \\(i=-1\\)\[ \r\n\]+at .*${srcfile}:$decimal\[\r\n\]+($hex in )?main \\(\\)\[ \r\n\]+at .*${srcfile}:$decimal\[\r\n\]+.*Value returned is \\$$decimal = 0" \
+ "Run till exit from #0 +incr \\(i=-1\\)\[ \r\n\]+at .*${srcfile}:$decimal\[\r\n\]+($hex in )?main \\(\\)\[ \r\n\]+at .*${srcfile}:$decimal\[\r\n\]+.*Value returned is ${::valnum_re} = 0" \
"go back to main from incr, first time"
@@ -72,7 +72,7 @@ gdb_test "finish" \
gdb_test_no_output "up-silently" "move up to decr"
gdb_test "finish" \
- "Run till exit from #1 +($hex in )?decr \\(i=0\\)\[ \r\n\]+at .*${srcfile}:$decimal\[\r\n\]+($hex in )?main \\(\\)\[ \r\n\]+at .*${srcfile}:$decimal\[\r\n\]+.*Value returned is \\$$decimal = -1" \
+ "Run till exit from #1 +($hex in )?decr \\(i=0\\)\[ \r\n\]+at .*${srcfile}:$decimal\[\r\n\]+($hex in )?main \\(\\)\[ \r\n\]+at .*${srcfile}:$decimal\[\r\n\]+.*Value returned is ${::valnum_re} = -1" \
"go back to main from decr"
@@ -87,7 +87,7 @@ gdb_test "continue" \
# Go back up again, make sure the return value is 0.
gdb_test "finish" \
- "Run till exit from #0 +incr \\(i=-1\\)\[ \r\n\]+at .*${srcfile}:$decimal\[\r\n\]+($hex in )?main \\(\\)\[ \r\n\]+at .*${srcfile}:$decimal\[\r\n\]+.*Value returned is \\$$decimal = 0" \
+ "Run till exit from #0 +incr \\(i=-1\\)\[ \r\n\]+at .*${srcfile}:$decimal\[\r\n\]+($hex in )?main \\(\\)\[ \r\n\]+at .*${srcfile}:$decimal\[\r\n\]+.*Value returned is ${::valnum_re} = 0" \
"go back to main from incr, second time"
diff --git a/gdb/testsuite/gdb.base/gnu_vector.exp b/gdb/testsuite/gdb.base/gnu_vector.exp
index a8be3072555..c1616fd3275 100644
--- a/gdb/testsuite/gdb.base/gnu_vector.exp
+++ b/gdb/testsuite/gdb.base/gnu_vector.exp
@@ -50,49 +50,49 @@ if { ![runto_main] } {
set endian [get_endianness]
# Test printing of character vector types
-gdb_test "print c4" "\\\$$decimal = \\{1, 2, 3, 4\\}"
-gdb_test "print c4\[2\]" "\\\$$decimal = 3"
+gdb_test "print c4" "${::valnum_re} = \\{1, 2, 3, 4\\}"
+gdb_test "print c4\[2\]" "${::valnum_re} = 3"
# Test operators on integer vector types
-gdb_test "print i4a" "\\\$$decimal = \\{2, 4, 8, 16\\}"
-gdb_test "print i4b" "\\\$$decimal = \\{1, 2, 8, 4\\}"
+gdb_test "print i4a" "${::valnum_re} = \\{2, 4, 8, 16\\}"
+gdb_test "print i4b" "${::valnum_re} = \\{1, 2, 8, 4\\}"
# Arithmetic operators
-gdb_test "print i4a + i4b" "\\\$$decimal = \\{3, 6, 16, 20\\}"
-gdb_test "print i4a - i4b" "\\\$$decimal = \\{1, 2, 0, 12\\}"
-gdb_test "print i4a * i4b" "\\\$$decimal = \\{2, 8, 64, 64\\}"
-gdb_test "print i4a / i4b" "\\\$$decimal = \\{2, 2, 1, 4\\}"
-gdb_test "print i4a % i4b" "\\\$$decimal = \\{0, 0, 0, 0\\}"
-gdb_test "print i4a++" "\\\$$decimal = \\{2, 4, 8, 16\\}"
-gdb_test "print ++i4a" "\\\$$decimal = \\{4, 6, 10, 18\\}"
-gdb_test "print i4a--" "\\\$$decimal = \\{4, 6, 10, 18\\}"
-gdb_test "print --i4a" "\\\$$decimal = \\{2, 4, 8, 16\\}"
-gdb_test "print +i4a" "\\\$$decimal = \\{2, 4, 8, 16\\}"
-gdb_test "print -i4a" "\\\$$decimal = \\{-2, -4, -8, -16\\}"
+gdb_test "print i4a + i4b" "${::valnum_re} = \\{3, 6, 16, 20\\}"
+gdb_test "print i4a - i4b" "${::valnum_re} = \\{1, 2, 0, 12\\}"
+gdb_test "print i4a * i4b" "${::valnum_re} = \\{2, 8, 64, 64\\}"
+gdb_test "print i4a / i4b" "${::valnum_re} = \\{2, 2, 1, 4\\}"
+gdb_test "print i4a % i4b" "${::valnum_re} = \\{0, 0, 0, 0\\}"
+gdb_test "print i4a++" "${::valnum_re} = \\{2, 4, 8, 16\\}"
+gdb_test "print ++i4a" "${::valnum_re} = \\{4, 6, 10, 18\\}"
+gdb_test "print i4a--" "${::valnum_re} = \\{4, 6, 10, 18\\}"
+gdb_test "print --i4a" "${::valnum_re} = \\{2, 4, 8, 16\\}"
+gdb_test "print +i4a" "${::valnum_re} = \\{2, 4, 8, 16\\}"
+gdb_test "print -i4a" "${::valnum_re} = \\{-2, -4, -8, -16\\}"
# Bitwise operators
-gdb_test "print i4a & i4b" "\\\$$decimal = \\{0, 0, 8, 0\\}"
-gdb_test "print i4a | i4b" "\\\$$decimal = \\{3, 6, 8, 20\\}"
-gdb_test "print i4a ^ i4b" "\\\$$decimal = \\{3, 6, 0, 20\\}"
-gdb_test "print ~i4a" "\\\$$decimal = \\{-3, -5, -9, -17\\}"
+gdb_test "print i4a & i4b" "${::valnum_re} = \\{0, 0, 8, 0\\}"
+gdb_test "print i4a | i4b" "${::valnum_re} = \\{3, 6, 8, 20\\}"
+gdb_test "print i4a ^ i4b" "${::valnum_re} = \\{3, 6, 0, 20\\}"
+gdb_test "print ~i4a" "${::valnum_re} = \\{-3, -5, -9, -17\\}"
# Shift operators
-gdb_test "print i4a << i4b" "\\\$$decimal = \\{4, 16, 2048, 256\\}"
-gdb_test "print i4a >> i4b" "\\\$$decimal = \\{1, 1, 0, 1\\}"
+gdb_test "print i4a << i4b" "${::valnum_re} = \\{4, 16, 2048, 256\\}"
+gdb_test "print i4a >> i4b" "${::valnum_re} = \\{1, 1, 0, 1\\}"
# Test operators on floating point vector types
-gdb_test "print f4a" "\\\$$decimal = \\{2, 4, 8, 16\\}"
-gdb_test "print f4b" "\\\$$decimal = \\{1, 2, 8, 4\\}"
+gdb_test "print f4a" "${::valnum_re} = \\{2, 4, 8, 16\\}"
+gdb_test "print f4b" "${::valnum_re} = \\{1, 2, 8, 4\\}"
# Arithmetic operators
-gdb_test "print f4a + f4b" "\\\$$decimal = \\{3, 6, 16, 20\\}"
-gdb_test "print f4a - f4b" "\\\$$decimal = \\{1, 2, 0, 12\\}"
-gdb_test "print f4a * f4b" "\\\$$decimal = \\{2, 8, 64, 64\\}"
-gdb_test "print f4a / f4b" "\\\$$decimal = \\{2, 2, 1, 4\\}"
-gdb_test "print +f4a" "\\\$$decimal = \\{2, 4, 8, 16\\}"
-gdb_test "print -f4a" "\\\$$decimal = \\{-2, -4, -8, -16\\}"
+gdb_test "print f4a + f4b" "${::valnum_re} = \\{3, 6, 16, 20\\}"
+gdb_test "print f4a - f4b" "${::valnum_re} = \\{1, 2, 0, 12\\}"
+gdb_test "print f4a * f4b" "${::valnum_re} = \\{2, 8, 64, 64\\}"
+gdb_test "print f4a / f4b" "${::valnum_re} = \\{2, 2, 1, 4\\}"
+gdb_test "print +f4a" "${::valnum_re} = \\{2, 4, 8, 16\\}"
+gdb_test "print -f4a" "${::valnum_re} = \\{-2, -4, -8, -16\\}"
# When casting to vector the input type must have the same length as
# the total length of the vector.
-gdb_test "print (char4) 0x01010101" "\\\$$decimal = \\{1, 1, 1, 1\\}"
-gdb_test "print (int2) lla" "\\\$$decimal = \\{1, 1\\}"
+gdb_test "print (char4) 0x01010101" "${::valnum_re} = \\{1, 1, 1, 1\\}"
+gdb_test "print (int2) lla" "${::valnum_re} = \\{1, 1\\}"
# Check that "whatis" doesn't peel off the destination type's typedef
# by mistake, in expressions that involve a cast to typedef type.
@@ -106,9 +106,9 @@ gdb_test "ptype (int2) lla" \
"type = int __attribute__ \\(\\(vector_size\\(2\\)\\)\\)"
if {![string compare $endian big]} {
- gdb_test "print (char4) ia" "\\\$$decimal = \\{0, 0, 0, 2\\}"
+ gdb_test "print (char4) ia" "${::valnum_re} = \\{0, 0, 0, 2\\}"
} else {
- gdb_test "print (char4) ia" "\\\$$decimal = \\{2, 0, 0, 0\\}"
+ gdb_test "print (char4) ia" "${::valnum_re} = \\{2, 0, 0, 0\\}"
}
gdb_test "print (int2) 1" "can only cast scalar to vector of same size"
@@ -129,31 +129,31 @@ gdb_test "print i4a + lla" "conversion of scalar to vector involves truncation"
gdb_test "print lla + c4" "conversion of scalar to vector involves truncation"
gdb_test "print lla + i4a" "conversion of scalar to vector involves truncation"
-gdb_test "print c4 + ib" "\\\$$decimal = \\{2, 3, 4, 5\\}"
-gdb_test "print i4a + ib" "\\\$$decimal = \\{3, 5, 9, 17\\}"
-gdb_test "print i4a + 1" "\\\$$decimal = \\{3, 5, 9, 17\\}"
-gdb_test "print 1 + i4a" "\\\$$decimal = \\{3, 5, 9, 17\\}"
-gdb_test "print fa - f4b" "\\\$$decimal = \\{1, 0, -6, -2\\}"
-gdb_test "print 2 - f4b" "\\\$$decimal = \\{1, 0, -6, -2\\}"
-gdb_test "print f4a * fb" "\\\$$decimal = \\{2, 4, 8, 16\\}"
-gdb_test "print f4a * 1" "\\\$$decimal = \\{2, 4, 8, 16\\}"
-gdb_test "print ia / i4b" "\\\$$decimal = \\{2, 1, 0, 0\\}"
-gdb_test "print 2 / i4b" "\\\$$decimal = \\{2, 1, 0, 0\\}"
-gdb_test "print i4a % ib" "\\\$$decimal = \\{0, 0, 0, 0\\}"
-gdb_test "print i4a % 1" "\\\$$decimal = \\{0, 0, 0, 0\\}"
-gdb_test "print ia & i4b" "\\\$$decimal = \\{0, 2, 0, 0\\}"
-gdb_test "print 2 & i4b" "\\\$$decimal = \\{0, 2, 0, 0\\}"
-gdb_test "print i4a | ib" "\\\$$decimal = \\{3, 5, 9, 17\\}"
-gdb_test "print i4a | 1" "\\\$$decimal = \\{3, 5, 9, 17\\}"
-gdb_test "print ia ^ i4b" "\\\$$decimal = \\{3, 0, 10, 6\\}"
-gdb_test "print 2 ^ i4b" "\\\$$decimal = \\{3, 0, 10, 6\\}"
-gdb_test "print i4a << ib" "\\\$$decimal = \\{4, 8, 16, 32\\}"
-gdb_test "print i4a << 1" "\\\$$decimal = \\{4, 8, 16, 32\\}"
-gdb_test "print i4a >> ib" "\\\$$decimal = \\{1, 2, 4, 8\\}"
-gdb_test "print i4a >> 1" "\\\$$decimal = \\{1, 2, 4, 8\\}"
-
-gdb_test "print i4a = \{2, 4, 8, 16\}" "\\\$$decimal = \\{2, 4, 8, 16\\}"
-gdb_test "print i4a <<= ib" "\\\$$decimal = \\{4, 8, 16, 32\\}"
+gdb_test "print c4 + ib" "${::valnum_re} = \\{2, 3, 4, 5\\}"
+gdb_test "print i4a + ib" "${::valnum_re} = \\{3, 5, 9, 17\\}"
+gdb_test "print i4a + 1" "${::valnum_re} = \\{3, 5, 9, 17\\}"
+gdb_test "print 1 + i4a" "${::valnum_re} = \\{3, 5, 9, 17\\}"
+gdb_test "print fa - f4b" "${::valnum_re} = \\{1, 0, -6, -2\\}"
+gdb_test "print 2 - f4b" "${::valnum_re} = \\{1, 0, -6, -2\\}"
+gdb_test "print f4a * fb" "${::valnum_re} = \\{2, 4, 8, 16\\}"
+gdb_test "print f4a * 1" "${::valnum_re} = \\{2, 4, 8, 16\\}"
+gdb_test "print ia / i4b" "${::valnum_re} = \\{2, 1, 0, 0\\}"
+gdb_test "print 2 / i4b" "${::valnum_re} = \\{2, 1, 0, 0\\}"
+gdb_test "print i4a % ib" "${::valnum_re} = \\{0, 0, 0, 0\\}"
+gdb_test "print i4a % 1" "${::valnum_re} = \\{0, 0, 0, 0\\}"
+gdb_test "print ia & i4b" "${::valnum_re} = \\{0, 2, 0, 0\\}"
+gdb_test "print 2 & i4b" "${::valnum_re} = \\{0, 2, 0, 0\\}"
+gdb_test "print i4a | ib" "${::valnum_re} = \\{3, 5, 9, 17\\}"
+gdb_test "print i4a | 1" "${::valnum_re} = \\{3, 5, 9, 17\\}"
+gdb_test "print ia ^ i4b" "${::valnum_re} = \\{3, 0, 10, 6\\}"
+gdb_test "print 2 ^ i4b" "${::valnum_re} = \\{3, 0, 10, 6\\}"
+gdb_test "print i4a << ib" "${::valnum_re} = \\{4, 8, 16, 32\\}"
+gdb_test "print i4a << 1" "${::valnum_re} = \\{4, 8, 16, 32\\}"
+gdb_test "print i4a >> ib" "${::valnum_re} = \\{1, 2, 4, 8\\}"
+gdb_test "print i4a >> 1" "${::valnum_re} = \\{1, 2, 4, 8\\}"
+
+gdb_test "print i4a = \{2, 4, 8, 16\}" "${::valnum_re} = \\{2, 4, 8, 16\\}"
+gdb_test "print i4a <<= ib" "${::valnum_re} = \\{4, 8, 16, 32\\}"
# Test some error scenarios
gdb_test "print i4a + d2" "Cannot perform operation on vectors with different types"
diff --git a/gdb/testsuite/gdb.base/infnan.exp b/gdb/testsuite/gdb.base/infnan.exp
index cc9000d176f..18a0d235525 100644
--- a/gdb/testsuite/gdb.base/infnan.exp
+++ b/gdb/testsuite/gdb.base/infnan.exp
@@ -23,5 +23,5 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
runto_main
-gdb_test "print a" "\\\$$decimal = inf"
-gdb_test "print b" "\\\$$decimal = nan\\(0x.*\\)"
+gdb_test "print a" "${::valnum_re} = inf"
+gdb_test "print b" "${::valnum_re} = nan\\(0x.*\\)"
diff --git a/gdb/testsuite/gdb.base/interact.exp b/gdb/testsuite/gdb.base/interact.exp
index 4b538131647..70a9825cb58 100644
--- a/gdb/testsuite/gdb.base/interact.exp
+++ b/gdb/testsuite/gdb.base/interact.exp
@@ -22,7 +22,7 @@ puts $fd "print 2"
close $fd
# The expected output from the script...
-set script_output "\\$\[0-9\]+ = 1\[\r\n\]+\\$\[0-9\]+ = 2.*"
+set script_output "${::valnum_re} = 1\[\r\n\]+${::valnum_re} = 2.*"
# Start a fresh GDB. We don't need an executable for this test, so
# nothing else to do in terms of testcase setup.
diff --git a/gdb/testsuite/gdb.base/multi-line-starts-subshell.exp b/gdb/testsuite/gdb.base/multi-line-starts-subshell.exp
index 6bf315b7881..be548281869 100644
--- a/gdb/testsuite/gdb.base/multi-line-starts-subshell.exp
+++ b/gdb/testsuite/gdb.base/multi-line-starts-subshell.exp
@@ -52,4 +52,4 @@ gdb_test_multiple "if 1\nshell ${shell_cmd}\nend\nPS1=\"$shell_prompt\"" $test {
}
# Check that we restore input in GDB correctly.
-gdb_test "print 1" "^\\\$$decimal = 1" "gdb input still works"
+gdb_test "print 1" "^${::valnum_re} = 1" "gdb input still works"
diff --git a/gdb/testsuite/gdb.base/new-ui.exp b/gdb/testsuite/gdb.base/new-ui.exp
index 6380f173966..6bc45392733 100644
--- a/gdb/testsuite/gdb.base/new-ui.exp
+++ b/gdb/testsuite/gdb.base/new-ui.exp
@@ -28,7 +28,7 @@ proc ensure_no_output {message} {
# Run a command and use an anchor to make sure no output appears
# before the command's expected output.
- gdb_test "print 999" "^\\\$$decimal = 999" $message
+ gdb_test "print 999" "^${::valnum_re} = 999" $message
}
# Run a few execution-related commands on CON1, and ensure the proper
diff --git a/gdb/testsuite/gdb.base/non-lazy-array-index.exp b/gdb/testsuite/gdb.base/non-lazy-array-index.exp
index d21b80b6d6d..48eb7db77c1 100644
--- a/gdb/testsuite/gdb.base/non-lazy-array-index.exp
+++ b/gdb/testsuite/gdb.base/non-lazy-array-index.exp
@@ -62,7 +62,7 @@ gdb_test_multiple "p \$.array\[1\]" "" {
-re "^\[^\$\]\[^\r\n\]+\r\n" {
exp_continue
}
- -re "^\\\$${decimal} = 2\r\n$gdb_prompt " {
+ -re "^${::valnum_re} = 2\r\n$gdb_prompt " {
if { $saw_memory_access } {
if { $saw_auxv_parse } {
# The expression parser may look up global symbols, which
diff --git a/gdb/testsuite/gdb.base/overlays.exp b/gdb/testsuite/gdb.base/overlays.exp
index d45412ba696..3f584ee83c3 100644
--- a/gdb/testsuite/gdb.base/overlays.exp
+++ b/gdb/testsuite/gdb.base/overlays.exp
@@ -66,7 +66,7 @@ proc get_func_address { func func_sym msg } {
set func_addr 0
send_gdb "print $func\n"
gdb_expect {
- -re "\\$\[0-9\]+ = $fptrcast (${hexx}) <$func_sym>.*$gdb_prompt $" {
+ -re "${::valnum_re} = $fptrcast (${hexx}) <$func_sym>.*$gdb_prompt $" {
set func_addr $expect_out(1,string)
pass "get $msg"
}
diff --git a/gdb/testsuite/gdb.base/prologue.exp b/gdb/testsuite/gdb.base/prologue.exp
index b8fd232a549..cd7c1bf8e4a 100644
--- a/gdb/testsuite/gdb.base/prologue.exp
+++ b/gdb/testsuite/gdb.base/prologue.exp
@@ -38,7 +38,7 @@ proc find_breakpoint_pc { sym } {
set pc 0
set msg "reading \$pc: $sym"
gdb_test_multiple "print/x \$pc" $msg {
- -re "\\\$$decimal = ($hex)\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = ($hex)\r\n$gdb_prompt $" {
set pc $expect_out(1,string)
pass $msg
}
@@ -55,4 +55,4 @@ set pc1 [find_breakpoint_pc "marker"]
set pc2 [find_breakpoint_pc "other"]
-gdb_test "print /d $pc1 == $pc2" "\\\$$decimal = 1" "same pc from minimal symbol"
+gdb_test "print /d $pc1 == $pc2" "${::valnum_re} = 1" "same pc from minimal symbol"
diff --git a/gdb/testsuite/gdb.base/ptr-typedef.exp b/gdb/testsuite/gdb.base/ptr-typedef.exp
index fbb4b48dde7..5dfd96d12ea 100644
--- a/gdb/testsuite/gdb.base/ptr-typedef.exp
+++ b/gdb/testsuite/gdb.base/ptr-typedef.exp
@@ -23,5 +23,5 @@ if {![runto marker1]} {
untested "couldn't run to marker1"
}
-gdb_test "print foo_ptr" "\\\$$decimal = \\\(struct foo \\\*\\\) $hex"
-gdb_test "print foz_ptr" "\\\$$decimal = \\\(foz\\\) $hex"
+gdb_test "print foo_ptr" "${::valnum_re} = \\\(struct foo \\\*\\\) $hex"
+gdb_test "print foz_ptr" "${::valnum_re} = \\\(foz\\\) $hex"
diff --git a/gdb/testsuite/gdb.base/randomize.exp b/gdb/testsuite/gdb.base/randomize.exp
index d9198e1272b..52c2ff71ab1 100644
--- a/gdb/testsuite/gdb.base/randomize.exp
+++ b/gdb/testsuite/gdb.base/randomize.exp
@@ -32,7 +32,7 @@ proc address_get { testname } {
gdb_continue_to_breakpoint "$testname - address set"
gdb_test_multiple "print/x p" $testname {
- -re "\\$\[0-9\]+ = (0x\[0-9a-f\]*)\r?\n$gdb_prompt $" {
+ -re "${::valnum_re} = (0x\[0-9a-f\]*)\r?\n$gdb_prompt $" {
pass $testname
return $expect_out(1,string)
}
diff --git a/gdb/testsuite/gdb.base/range-stepping.exp b/gdb/testsuite/gdb.base/range-stepping.exp
index 531687df966..53083f066c3 100644
--- a/gdb/testsuite/gdb.base/range-stepping.exp
+++ b/gdb/testsuite/gdb.base/range-stepping.exp
@@ -41,7 +41,7 @@ with_test_prefix "multi insns" {
set pc_before_stepping ""
set test "pc before stepping"
gdb_test_multiple "print/x \$pc" $test {
- -re "\\\$$decimal = (\[^\r\n\]*)\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = (\[^\r\n\]*)\r\n$gdb_prompt $" {
set pc_before_stepping $expect_out(1,string)
pass $test
}
@@ -67,7 +67,7 @@ with_test_prefix "multi insns" {
set pc_after_stepping ""
set msg "pc after stepping"
gdb_test_multiple "print/x \$pc" $msg {
- -re "\\\$$decimal = (\[^\r\n\]*)\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = (\[^\r\n\]*)\r\n$gdb_prompt $" {
set pc_after_stepping $expect_out(1,string)
pass $msg
}
diff --git a/gdb/testsuite/gdb.base/relocate.exp b/gdb/testsuite/gdb.base/relocate.exp
index 99e8cb67448..8c1ffc52e50 100644
--- a/gdb/testsuite/gdb.base/relocate.exp
+++ b/gdb/testsuite/gdb.base/relocate.exp
@@ -317,7 +317,7 @@ clean_restart
gdb_file_cmd ${binfile}
# Check the values of the variables.
-gdb_test "print static_foo" "\\\$$decimal = 1"
-gdb_test "print static_bar" "\\\$$decimal = 2"
-gdb_test "print global_foo" "\\\$$decimal = 3"
-gdb_test "print global_bar" "\\\$$decimal = 4"
+gdb_test "print static_foo" "${::valnum_re} = 1"
+gdb_test "print static_bar" "${::valnum_re} = 2"
+gdb_test "print global_foo" "${::valnum_re} = 3"
+gdb_test "print global_bar" "${::valnum_re} = 4"
diff --git a/gdb/testsuite/gdb.base/scope.exp b/gdb/testsuite/gdb.base/scope.exp
index 9430c4bf59c..b82465a1184 100644
--- a/gdb/testsuite/gdb.base/scope.exp
+++ b/gdb/testsuite/gdb.base/scope.exp
@@ -42,51 +42,51 @@ proc_with_prefix test_at_main {} {
gdb_test "next" "$decimal.*foo \\(\\);" "next over init0() in main"
# Print scope0.c::filelocal, which is 1
- gdb_test "print filelocal" "\\\$$decimal = 1"
- gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal = 1" "print 'scope0.c'::filelocal at main"
+ gdb_test "print filelocal" "${::valnum_re} = 1"
+ gdb_test "print 'scope0.c'::filelocal" "${::valnum_re} = 1" "print 'scope0.c'::filelocal at main"
# Print scope0.c::filelocal_bss, which is 101
- gdb_test "print filelocal_bss" "\\\$$decimal = 101"
- gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal = 101" "print 'scope0.c'::filelocal_bss in test_at_main"
+ gdb_test "print filelocal_bss" "${::valnum_re} = 101"
+ gdb_test "print 'scope0.c'::filelocal_bss" "${::valnum_re} = 101" "print 'scope0.c'::filelocal_bss in test_at_main"
# Print scope0.c::filelocal_ro, which is 201
# No clue why the rs6000 fails this test.
if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
- gdb_test "print filelocal_ro" "\\\$$decimal = 201" "print filelocal_ro in test_at_main"
+ gdb_test "print filelocal_ro" "${::valnum_re} = 201" "print filelocal_ro in test_at_main"
if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
- gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal = 201" "print 'scope0.c'::filelocal_ro"
+ gdb_test "print 'scope0.c'::filelocal_ro" "${::valnum_re} = 201" "print 'scope0.c'::filelocal_ro"
# Print scope1.c::filelocal, which is 2
if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
- gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal = 2" "print 'scope1.c'::filelocal"
+ gdb_test "print 'scope1.c'::filelocal" "${::valnum_re} = 2" "print 'scope1.c'::filelocal"
# Print scope1.c::filelocal_bss, which is 102
if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
- gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal = 102" "print 'scope1.c'::filelocal_bss"
+ gdb_test "print 'scope1.c'::filelocal_bss" "${::valnum_re} = 102" "print 'scope1.c'::filelocal_bss"
# Print scope1.c::filelocal_ro, which is 202
if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
- gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal = 202" "print 'scope1.c'::filelocal_ro"
+ gdb_test "print 'scope1.c'::filelocal_ro" "${::valnum_re} = 202" "print 'scope1.c'::filelocal_ro"
# Print scope1.c::foo::funclocal, which is 3
- gdb_test "print foo::funclocal" "\\\$$decimal = 3"
+ gdb_test "print foo::funclocal" "${::valnum_re} = 3"
if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
- gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal = 3" "print 'scope1.c'::foo::funclocal"
+ gdb_test "print 'scope1.c'::foo::funclocal" "${::valnum_re} = 3" "print 'scope1.c'::foo::funclocal"
# Print scope1.c::foo::funclocal_ro, which is 203
- gdb_test "print foo::funclocal_ro" "\\\$$decimal = 203"
+ gdb_test "print foo::funclocal_ro" "${::valnum_re} = 203"
if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
- gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal = 203" "print 'scope1.c'::foo::funclocal_ro"
+ gdb_test "print 'scope1.c'::foo::funclocal_ro" "${::valnum_re} = 203" "print 'scope1.c'::foo::funclocal_ro"
# Print scope1.c::bar::funclocal, which is 4
- gdb_test "print bar::funclocal" "\\\$$decimal = 4"
+ gdb_test "print bar::funclocal" "${::valnum_re} = 4"
if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
- gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal = 4" "print 'scope1.c'::bar::funclocal"
+ gdb_test "print 'scope1.c'::bar::funclocal" "${::valnum_re} = 4" "print 'scope1.c'::bar::funclocal"
}
proc_with_prefix test_at_foo {} {
@@ -99,78 +99,78 @@ proc_with_prefix test_at_foo {} {
gdb_test "next" ".*bar \\(\\);"
# Print scope0.c::filelocal, which is 1
- gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal = 1" "print 'scope0.c'::filelocal at foo"
+ gdb_test "print 'scope0.c'::filelocal" "${::valnum_re} = 1" "print 'scope0.c'::filelocal at foo"
# Print scope0.c::filelocal_bss, which is 101
- gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal = 101" "print 'scope0.c'::filelocal_bss in test_at_foo"
+ gdb_test "print 'scope0.c'::filelocal_bss" "${::valnum_re} = 101" "print 'scope0.c'::filelocal_bss in test_at_foo"
# Print scope0.c::filelocal_ro, which is 201
if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
- gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal = 201" "print 'scope0.c'::filelocal_ro"
+ gdb_test "print 'scope0.c'::filelocal_ro" "${::valnum_re} = 201" "print 'scope0.c'::filelocal_ro"
# Print scope1.c::filelocal, which is 2
- gdb_test "print filelocal" "\\\$$decimal = 2" "print filelocal at foo"
+ gdb_test "print filelocal" "${::valnum_re} = 2" "print filelocal at foo"
if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
- gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal = 2" "print 'scope1.c'::filelocal at foo"
+ gdb_test "print 'scope1.c'::filelocal" "${::valnum_re} = 2" "print 'scope1.c'::filelocal at foo"
- gdb_test "print filelocal_bss" "\\\$$decimal = 102" \
+ gdb_test "print filelocal_bss" "${::valnum_re} = 102" \
"print filelocal_bss at foo"
if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
- gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal = 102" "print 'scope1.c'::filelocal_bss at foo"
+ gdb_test "print 'scope1.c'::filelocal_bss" "${::valnum_re} = 102" "print 'scope1.c'::filelocal_bss at foo"
- gdb_test "print filelocal_ro" "\\\$$decimal = 202" \
+ gdb_test "print filelocal_ro" "${::valnum_re} = 202" \
"print filelocal_ro at foo"
if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
- gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal = 202" "print 'scope1.c'::filelocal_ro at foo"
+ gdb_test "print 'scope1.c'::filelocal_ro" "${::valnum_re} = 202" "print 'scope1.c'::filelocal_ro at foo"
# Print scope1.c::foo::funclocal, which is 3
- gdb_test "print funclocal" "\\\$$decimal = 3" "print funclocal at foo"
+ gdb_test "print funclocal" "${::valnum_re} = 3" "print funclocal at foo"
- gdb_test "print foo::funclocal" "\\\$$decimal = 3" \
+ gdb_test "print foo::funclocal" "${::valnum_re} = 3" \
"print foo::funclocal at foo"
if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
- gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal = 3" "print 'scope1.c'::foo::funclocal at foo"
+ gdb_test "print 'scope1.c'::foo::funclocal" "${::valnum_re} = 3" "print 'scope1.c'::foo::funclocal at foo"
# Print scope1.c::foo::funclocal_bss, which is 103
- gdb_test "print funclocal_bss" "\\\$$decimal = 103" \
+ gdb_test "print funclocal_bss" "${::valnum_re} = 103" \
"print funclocal_bss at foo"
- gdb_test "print foo::funclocal_bss" "\\\$$decimal = 103" \
+ gdb_test "print foo::funclocal_bss" "${::valnum_re} = 103" \
"print foo::funclocal_bss at foo"
if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
- gdb_test "print 'scope1.c'::foo::funclocal_bss" "\\\$$decimal = 103" "print 'scope1.c'::foo::funclocal_bss at foo"
+ gdb_test "print 'scope1.c'::foo::funclocal_bss" "${::valnum_re} = 103" "print 'scope1.c'::foo::funclocal_bss at foo"
# Print scope1.c::foo::funclocal_ro, which is 203
- gdb_test "print funclocal_ro" "\\\$$decimal = 203" \
+ gdb_test "print funclocal_ro" "${::valnum_re} = 203" \
"print funclocal_ro at foo"
- gdb_test "print foo::funclocal_ro" "\\\$$decimal = 203" \
+ gdb_test "print foo::funclocal_ro" "${::valnum_re} = 203" \
"print foo::funclocal_ro at foo"
if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
- gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal = 203" "print 'scope1.c'::foo::funclocal_ro at foo"
+ gdb_test "print 'scope1.c'::foo::funclocal_ro" "${::valnum_re} = 203" "print 'scope1.c'::foo::funclocal_ro at foo"
# Print scope1.c::bar::funclocal, which is 4
- gdb_test "print bar::funclocal" "\\\$$decimal = 4" \
+ gdb_test "print bar::funclocal" "${::valnum_re} = 4" \
"print bar::funclocal at foo"
if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
- gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal = 4" "print 'scope1.c'::bar::funclocal at foo"
+ gdb_test "print 'scope1.c'::bar::funclocal" "${::valnum_re} = 4" "print 'scope1.c'::bar::funclocal at foo"
}
@@ -184,64 +184,64 @@ proc_with_prefix test_at_bar {} {
gdb_test "next"
# Print scope0.c::filelocal, which is 1
- gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal = 1" "print 'scope0.c'::filelocal at bar"
+ gdb_test "print 'scope0.c'::filelocal" "${::valnum_re} = 1" "print 'scope0.c'::filelocal at bar"
# Print scope0.c::filelocal_bss, which is 101
- gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal = 101" "print 'scope0.c'::filelocal_bss in test_at_bar"
+ gdb_test "print 'scope0.c'::filelocal_bss" "${::valnum_re} = 101" "print 'scope0.c'::filelocal_bss in test_at_bar"
# Print scope0.c::filelocal_ro, which is 201
if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
- gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal = 201" "print 'scope0.c'::filelocal_ro at bar"
+ gdb_test "print 'scope0.c'::filelocal_ro" "${::valnum_re} = 201" "print 'scope0.c'::filelocal_ro at bar"
# Print scope1.c::filelocal, which is 2
- gdb_test "print filelocal" "\\\$$decimal = 2" "print filelocal at bar"
+ gdb_test "print filelocal" "${::valnum_re} = 2" "print filelocal at bar"
if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
- gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal = 2" "print 'scope1.c'::filelocal at bar"
+ gdb_test "print 'scope1.c'::filelocal" "${::valnum_re} = 2" "print 'scope1.c'::filelocal at bar"
# Print scope1.c::filelocal_bss, which is 102
- gdb_test "print filelocal_bss" "\\\$$decimal = 102" "print filelocal_bss at bar"
+ gdb_test "print filelocal_bss" "${::valnum_re} = 102" "print filelocal_bss at bar"
if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
- gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal = 102" "print 'scope1.c'::filelocal_bss at bar"
+ gdb_test "print 'scope1.c'::filelocal_bss" "${::valnum_re} = 102" "print 'scope1.c'::filelocal_bss at bar"
# Print scope1.c::filelocal_ro, which is 202
- gdb_test "print filelocal_ro" "\\\$$decimal = 202" "print filelocal_ro in test_at_bar"
+ gdb_test "print filelocal_ro" "${::valnum_re} = 202" "print filelocal_ro in test_at_bar"
if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
- gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal = 202" "print 'scope1.c'::filelocal_ro at bar"
+ gdb_test "print 'scope1.c'::filelocal_ro" "${::valnum_re} = 202" "print 'scope1.c'::filelocal_ro at bar"
# Print scope1.c::foo::funclocal, which is 3
- gdb_test "print foo::funclocal" "\\\$$decimal = 3" "print foo::funclocal at bar"
+ gdb_test "print foo::funclocal" "${::valnum_re} = 3" "print foo::funclocal at bar"
if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
- gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal = 3" "print 'scope1.c'::foo::funclocal at bar"
+ gdb_test "print 'scope1.c'::foo::funclocal" "${::valnum_re} = 3" "print 'scope1.c'::foo::funclocal at bar"
# Print scope1.c::foo::funclocal_bss, which is 103
- gdb_test "print foo::funclocal_bss" "\\\$$decimal = 103" "print foo::funclocal_bss at bar"
+ gdb_test "print foo::funclocal_bss" "${::valnum_re} = 103" "print foo::funclocal_bss at bar"
if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
- gdb_test "print 'scope1.c'::foo::funclocal_bss" "\\\$$decimal = 103" "print 'scope1.c'::foo::funclocal_bss at bar"
+ gdb_test "print 'scope1.c'::foo::funclocal_bss" "${::valnum_re} = 103" "print 'scope1.c'::foo::funclocal_bss at bar"
# Print scope1.c::foo::funclocal_ro, which is 203
- gdb_test "print foo::funclocal_ro" "\\\$$decimal = 203" "print foo::funclocal_ro at bar"
+ gdb_test "print foo::funclocal_ro" "${::valnum_re} = 203" "print foo::funclocal_ro at bar"
if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
- gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal = 203" "print 'scope1.c'::foo::funclocal_ro at bar"
+ gdb_test "print 'scope1.c'::foo::funclocal_ro" "${::valnum_re} = 203" "print 'scope1.c'::foo::funclocal_ro at bar"
# Print scope1.c::bar::funclocal, which is 4
- gdb_test "print funclocal" "\\\$$decimal = 4" "print funclocal at bar"
- gdb_test "print bar::funclocal" "\\\$$decimal = 4" "print bar::funclocal at bar"
+ gdb_test "print funclocal" "${::valnum_re} = 4" "print funclocal at bar"
+ gdb_test "print bar::funclocal" "${::valnum_re} = 4" "print bar::funclocal at bar"
if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
- gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal = 4" "print 'scope1.c'::bar::funclocal at bar"
+ gdb_test "print 'scope1.c'::bar::funclocal" "${::valnum_re} = 4" "print 'scope1.c'::bar::funclocal at bar"
# Print scope1.c::bar::funclocal_bss, which is 104
- gdb_test "print funclocal_bss" "\\\$$decimal = 104" "print funclocal_bss at bar"
- gdb_test "print bar::funclocal_bss" "\\\$$decimal = 104" "print bar::funclocal_bss at bar"
+ gdb_test "print funclocal_bss" "${::valnum_re} = 104" "print funclocal_bss at bar"
+ gdb_test "print bar::funclocal_bss" "${::valnum_re} = 104" "print bar::funclocal_bss at bar"
if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
- gdb_test "print 'scope1.c'::bar::funclocal_bss" "\\\$$decimal = 104" "print 'scope1.c'::bar::funclocal_bss at bar"
+ gdb_test "print 'scope1.c'::bar::funclocal_bss" "${::valnum_re} = 104" "print 'scope1.c'::bar::funclocal_bss at bar"
}
# This test has little to do with local scopes, but it is in scope.exp anyway.
diff --git a/gdb/testsuite/gdb.base/set-cwd.exp b/gdb/testsuite/gdb.base/set-cwd.exp
index a45ffd4a743..3fbffdc6136 100644
--- a/gdb/testsuite/gdb.base/set-cwd.exp
+++ b/gdb/testsuite/gdb.base/set-cwd.exp
@@ -40,7 +40,7 @@ proc_with_prefix test_tilde_expansion { } {
set home ""
set test "print home var"
gdb_test_multiple "print home" $test {
- -re "\\\$$decimal = $hex \"\(.+\)\"\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = $hex \"\(.+\)\"\r\n$gdb_prompt $" {
set home $expect_out(1,string)
pass $test
}
@@ -54,7 +54,7 @@ proc_with_prefix test_tilde_expansion { } {
set curdir ""
set test "print dir var"
gdb_test_multiple "print dir" $test {
- -re "\\\$$decimal = \"\(.+\)\"\(, .*repeats.*\)?\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = \"\(.+\)\"\(, .*repeats.*\)?\r\n$gdb_prompt $" {
set curdir $expect_out(1,string)
pass $test
}
@@ -107,7 +107,7 @@ proc_with_prefix test_cd_into_dir { } {
gdb_breakpoint [gdb_get_line_number "break-here"]
gdb_continue_to_breakpoint "break-here" ".* break-here .*"
- gdb_test "print dir" "\\\$$decimal = \"$tmpdir\", .*" \
+ gdb_test "print dir" "${::valnum_re} = \"$tmpdir\", .*" \
"inferior cwd is correctly set"
set gdb_cwd_after_run ""
@@ -164,7 +164,7 @@ proc_with_prefix test_cwd_reset { } {
gdb_breakpoint [gdb_get_line_number "break-here"]
gdb_continue_to_breakpoint "break-here" ".* break-here .*"
- gdb_test "print dir" "\\\$$decimal = \"$tmpdir\", .*" \
+ gdb_test "print dir" "${::valnum_re} = \"$tmpdir\", .*" \
"inferior cwd is correctly set"
# Reset the inferior's cwd.
@@ -178,7 +178,7 @@ proc_with_prefix test_cwd_reset { } {
gdb_breakpoint [gdb_get_line_number "break-here"]
gdb_continue_to_breakpoint "break-here" ".* break-here .*"
- gdb_test "print dir" "\\\$$decimal = \"$gdb_cwd\", .*" \
+ gdb_test "print dir" "${::valnum_re} = \"$gdb_cwd\", .*" \
"inferior cwd got reset correctly"
}
}
diff --git a/gdb/testsuite/gdb.base/share-env-with-gdbserver.exp b/gdb/testsuite/gdb.base/share-env-with-gdbserver.exp
index 238f113119e..e1b3540d5d7 100644
--- a/gdb/testsuite/gdb.base/share-env-with-gdbserver.exp
+++ b/gdb/testsuite/gdb.base/share-env-with-gdbserver.exp
@@ -51,7 +51,7 @@ proc check_getenv { var_name var_value { test_msg "" } { empty_var_p 0 } } {
set var_value_match "$hex \"$var_value\""
}
- gdb_test "print my_getenv (\"$var_name\")" "\\\$$decimal = $var_value_match" \
+ gdb_test "print my_getenv (\"$var_name\")" "${::valnum_re} = $var_value_match" \
$test_msg
}
@@ -210,11 +210,11 @@ proc test_unset { } {
set test_msg "check if unset works"
set found_home 0
gdb_test_multiple "print my_getenv (\"HOME\")" $test_msg {
- -re "\\\$$decimal = $hex \".*\"\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = $hex \".*\"\r\n$gdb_prompt $" {
pass $test_msg
set found_home 1
}
- -re "\\\$$decimal = 0x0\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = 0x0\r\n$gdb_prompt $" {
untested $test_msg
}
}
diff --git a/gdb/testsuite/gdb.base/shell.exp b/gdb/testsuite/gdb.base/shell.exp
index 71d95d42122..f6b36dc3a7c 100644
--- a/gdb/testsuite/gdb.base/shell.exp
+++ b/gdb/testsuite/gdb.base/shell.exp
@@ -49,14 +49,14 @@ with_test_prefix "\$_shell convenience function" {
gdb_test "p \$_shell(\"false\")" " = 1"
# Test command with arguments.
- gdb_test "p \$_shell(\"echo foo\")" "foo\r\n\\$${decimal} = 0"
+ gdb_test "p \$_shell(\"echo foo\")" "foo\r\n${::valnum_re} = 0"
# Check the type of the result.
gdb_test "ptype \$_shell(\"true\")" "type = int"
# Test passing a non-literal string as command name.
gdb_test "p \$cmd = \"echo bar\"" " = \"echo bar\""
- gdb_test "p \$_shell(\$cmd)" "bar\r\n\\$${decimal} = 0"
+ gdb_test "p \$_shell(\$cmd)" "bar\r\n${::valnum_re} = 0"
# Test executing a non-existing command. The result is
# shell-dependent, but most (all?) POSIX-like shells return 127 in
diff --git a/gdb/testsuite/gdb.base/signals.exp b/gdb/testsuite/gdb.base/signals.exp
index 51adb19e613..5ce3ff12d57 100644
--- a/gdb/testsuite/gdb.base/signals.exp
+++ b/gdb/testsuite/gdb.base/signals.exp
@@ -88,7 +88,7 @@ if {[runto_main]} {
# ...call the function
- gdb_test "p func1 ()" "^\\\$$decimal = void" \
+ gdb_test "p func1 ()" "^${::valnum_re} = void" \
"p func1 () #1"
# ...veryfiy that the cout was updated
diff --git a/gdb/testsuite/gdb.base/solib-disc.exp b/gdb/testsuite/gdb.base/solib-disc.exp
index e2898699877..a9b2bd471ee 100644
--- a/gdb/testsuite/gdb.base/solib-disc.exp
+++ b/gdb/testsuite/gdb.base/solib-disc.exp
@@ -60,7 +60,7 @@ gdb_test "continue" "Stopped due to shared library event.*" "continue to load"
set msg "save \$pc after load"
set saved_pc ""
gdb_test_multiple "print/x \$pc" $msg {
- -re "\\\$$decimal = (\[^\r\n\]*)\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = (\[^\r\n\]*)\r\n$gdb_prompt $" {
set saved_pc $expect_out(1,string)
pass $msg
}
@@ -74,7 +74,7 @@ if { [gdb_reconnect] == 0 } {
return 0
}
-gdb_test "print/x \$pc" "\\\$$decimal = $saved_pc" "check \$pc after load"
+gdb_test "print/x \$pc" "${::valnum_re} = $saved_pc" "check \$pc after load"
gdb_test "continue" "Stopped due to shared library event.*" "continue to unload"
@@ -82,7 +82,7 @@ gdb_test "continue" "Stopped due to shared library event.*" "continue to unload"
set msg "save \$pc after unload"
set saved_pc ""
gdb_test_multiple "print/x \$pc" $msg {
- -re "\\\$$decimal = (\[^\r\n\]*)\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = (\[^\r\n\]*)\r\n$gdb_prompt $" {
set saved_pc $expect_out(1,string)
pass $msg
}
@@ -96,4 +96,4 @@ if { [gdb_reconnect] == 0 } {
return 0
}
-gdb_test "print/x \$pc" "\\\$$decimal = $saved_pc" "check \$pc after unload"
+gdb_test "print/x \$pc" "${::valnum_re} = $saved_pc" "check \$pc after unload"
diff --git a/gdb/testsuite/gdb.base/startup-with-shell.exp b/gdb/testsuite/gdb.base/startup-with-shell.exp
index 5a9b69e9b9e..b27cdce63d7 100644
--- a/gdb/testsuite/gdb.base/startup-with-shell.exp
+++ b/gdb/testsuite/gdb.base/startup-with-shell.exp
@@ -81,7 +81,7 @@ proc run_test { args on_re off_re testname { problematic_on false } } {
setup_xfail "*-*-*" gdb/28392
}
- gdb_test "print argv\[1\]" "\\\$$::decimal = $::hex $re" $testname
+ gdb_test "print argv\[1\]" "${::valnum_re} = $::hex $re" $testname
}
}
}
diff --git a/gdb/testsuite/gdb.base/structs3.exp b/gdb/testsuite/gdb.base/structs3.exp
index 4eea63b4305..bdcf19a9932 100644
--- a/gdb/testsuite/gdb.base/structs3.exp
+++ b/gdb/testsuite/gdb.base/structs3.exp
@@ -25,7 +25,7 @@ if {![runto_main]} {
return -1
}
-set vhn "\\$\[0-9\]+"
+set vhn "${::valnum_re}"
# Check the real contents.
gdb_test "print two" "$vhn = {one = {x = 1}, x = 2, y = 3}"
diff --git a/gdb/testsuite/gdb.base/style.exp b/gdb/testsuite/gdb.base/style.exp
index 23d50f4cfad..2bffe8cf437 100644
--- a/gdb/testsuite/gdb.base/style.exp
+++ b/gdb/testsuite/gdb.base/style.exp
@@ -213,7 +213,7 @@ proc run_style_tests { } {
set sfield [limited_style string_field variable]
set efield [limited_style e_field variable]
set evalue [limited_style VALUE_TWO variable]
- set lhs [limited_style "\\\$$decimal" variable]
+ set lhs [limited_style "${::valnum_re}" variable]
gdb_test "print struct_value" \
"$lhs = \{$ifield = 23,.*$sfield = .*,.*$efield = $evalue.*"
@@ -1044,7 +1044,7 @@ proc test_finish_styling {} {
return
}
- gdb_test "finish" "Value returned is [style \\\$$::decimal variable] = 0"
+ gdb_test "finish" "Value returned is [style ${::valnum_re} variable] = 0"
}
# Check to see if the Python styling of disassembler output is
diff --git a/gdb/testsuite/gdb.cp/bs15503.exp b/gdb/testsuite/gdb.cp/bs15503.exp
index f48d692ca25..3a1ec22b5a4 100644
--- a/gdb/testsuite/gdb.cp/bs15503.exp
+++ b/gdb/testsuite/gdb.cp/bs15503.exp
@@ -45,8 +45,8 @@ gdb_continue_to_breakpoint "find position where blank needs to be inserted"
# Call some string methods.
-gdb_test "print s.length()" "\\$\[0-9\]+ = 42"
-gdb_test "print s\[0\]" "\\$\[0-9\]+ =.* 'I'"
-gdb_test "print s\[s.length()-1\]" "\\$\[0-9\]+ =.* 'g'"
+gdb_test "print s.length()" "${::valnum_re} = 42"
+gdb_test "print s\[0\]" "${::valnum_re} =.* 'I'"
+gdb_test "print s\[s.length()-1\]" "${::valnum_re} =.* 'g'"
gdb_test "print (const char *) s" \
- "\\$\[0-9\]+ = $hex \"I am a short stringand now a longer string\""
+ "${::valnum_re} = $hex \"I am a short stringand now a longer string\""
diff --git a/gdb/testsuite/gdb.cp/call-c.exp b/gdb/testsuite/gdb.cp/call-c.exp
index 8cb487a6092..bdbe4277239 100644
--- a/gdb/testsuite/gdb.cp/call-c.exp
+++ b/gdb/testsuite/gdb.cp/call-c.exp
@@ -34,9 +34,9 @@ runto_main
gdb_test "b [gdb_get_line_number {breakpoint here} ${testfile}.cc ]" \
".*Breakpoint .*call-c.*"
-gdb_test "print foo(1)" "\\\$$decimal = 1"
+gdb_test "print foo(1)" "${::valnum_re} = 1"
gdb_test "continue" ".*breakpoint here.*" "continue to bp"
-gdb_test "print rf->func()" "\\\$$decimal = 1"
+gdb_test "print rf->func()" "${::valnum_re} = 1"
gdb_test "print sum_vararg_int(0)" "0"
gdb_test "print sum_vararg_int(1, 10)" "10"
@@ -52,4 +52,4 @@ gdb_test "print vararg_func(11, 12, 13.5)" "2"
gdb_test "print vararg_func(14, 15, \"16\")" "2"
# Regression test for method call via a typedef.
-gdb_test "print handle->func()" "\\\$$decimal = 1"
+gdb_test "print handle->func()" "${::valnum_re} = 1"
diff --git a/gdb/testsuite/gdb.cp/classes.exp b/gdb/testsuite/gdb.cp/classes.exp
index 231c6c7cff2..ea4b2033b83 100644
--- a/gdb/testsuite/gdb.cp/classes.exp
+++ b/gdb/testsuite/gdb.cp/classes.exp
@@ -491,7 +491,7 @@ proc test_enums {} {
# 2008-08-21 we can output the qualifiers for DWARF-2.
gdb_test "print obj_with_enum" \
- "\\$\[0-9\]+ = \{priv_enum = (ClassWithEnum::)?red, x = 0\}" \
+ "${::valnum_re} = \{priv_enum = (ClassWithEnum::)?red, x = 0\}" \
"print obj_with_enum (1)"
# advance one line
@@ -501,12 +501,12 @@ proc test_enums {} {
# print the object again
gdb_test "print obj_with_enum" \
- "\\$\[0-9\]+ = \{priv_enum = (ClassWithEnum::)?green, x = 0\}" \
+ "${::valnum_re} = \{priv_enum = (ClassWithEnum::)?green, x = 0\}" \
"print obj_with_enum, 2"
# print the enum member
- gdb_test "print obj_with_enum.priv_enum" "\\$\[0-9\]+ = (ClassWithEnum::)?green"
+ gdb_test "print obj_with_enum.priv_enum" "${::valnum_re} = (ClassWithEnum::)?green"
# ptype on the enum member
@@ -585,7 +585,7 @@ proc test_enums {} {
# See PR gdb/1588.
gdb_test_multiple "print (ClassWithEnum::PrivEnum) 42" "print (ClassWithEnum::PrivEnum) 42" {
- -re "\\$\[0-9\]+ = (ClassWithEnum::)?yellow$nl$gdb_prompt $" {
+ -re "${::valnum_re} = (ClassWithEnum::)?yellow$nl$gdb_prompt $" {
pass "print (ClassWithEnum::PrivEnum) 42"
}
-re "A (parse|syntax) error in expression, near `42'.$nl$gdb_prompt $" {
@@ -596,7 +596,7 @@ proc test_enums {} {
}
gdb_test_multiple "print ('ClassWithEnum::PrivEnum') 42" "print ('ClassWithEnum::PrivEnum') 42" {
- -re "\\$\[0-9\]+ = (ClassWithEnum::)?yellow$nl$gdb_prompt $" {
+ -re "${::valnum_re} = (ClassWithEnum::)?yellow$nl$gdb_prompt $" {
# gcc 3.3.2 -gstabs+
# gcc HEAD 2003-12-28 21:08:30 UTC -gstabs+
pass "print ('ClassWithEnum::PrivEnum') 42"
@@ -615,9 +615,9 @@ proc test_enums {} {
proc test_pointers_to_class_members {} {
gdb_test "print Bar::z" "Cannot reference non-static field \"z\""
- gdb_test "print &Foo::x" "\\$\[0-9\]+ = &Foo::x"
- gdb_test "print (int)&Foo::x" "\\$\[0-9\]+ = 0"
- gdb_test "print (int)&Bar::y == 2*sizeof(int)" "\\$\[0-9\]+ = true"
+ gdb_test "print &Foo::x" "${::valnum_re} = &Foo::x"
+ gdb_test "print (int)&Foo::x" "${::valnum_re} = 0"
+ gdb_test "print (int)&Bar::y == 2*sizeof(int)" "${::valnum_re} = true"
gdb_test "ptype Bar::z" "type = int"
gdb_test "ptype &Bar::z" "type = int Bar::\\*"
@@ -630,12 +630,12 @@ proc test_pointers_to_class_members {} {
proc test_static_members {} {
global hex
- gdb_test "print Foo::st" "\\$\[0-9\]+ = 100"
+ gdb_test "print Foo::st" "${::valnum_re} = 100"
gdb_test_no_output "set foo.st = 200" ""
- gdb_test "print bar.st" "\\$\[0-9\]+ = 200"
- gdb_test "print &foo.st" "\\$\[0-9\]+ = \\(int ?\\*\\) $hex <Foo::st>"
- gdb_test "print &Bar::st" "\\$\[0-9\]+ = \\(int ?\\*\\) $hex <Foo::st>"
- gdb_test "print *\$" "\\$\[0-9\]+ = 200"
+ gdb_test "print bar.st" "${::valnum_re} = 200"
+ gdb_test "print &foo.st" "${::valnum_re} = \\(int ?\\*\\) $hex <Foo::st>"
+ gdb_test "print &Bar::st" "${::valnum_re} = \\(int ?\\*\\) $hex <Foo::st>"
+ gdb_test "print *\$" "${::valnum_re} = 200"
gdb_test_no_output "set print static-members off"
gdb_test "print csi" \
diff --git a/gdb/testsuite/gdb.cp/converts.exp b/gdb/testsuite/gdb.cp/converts.exp
index abc583c5299..7d26db9f302 100644
--- a/gdb/testsuite/gdb.cp/converts.exp
+++ b/gdb/testsuite/gdb.cp/converts.exp
@@ -68,7 +68,7 @@ gdb_test_multiple "p foo3_1 (0, 0)" $t {
fail "$t (conversion failed)"
}
- -re "\\$\[0-9\]+ = 31$nl$gdb_prompt $" {
+ -re "${::valnum_re} = 31$nl$gdb_prompt $" {
pass $t
}
}
diff --git a/gdb/testsuite/gdb.cp/cp-relocate.exp b/gdb/testsuite/gdb.cp/cp-relocate.exp
index 8866324148f..fb45313466b 100644
--- a/gdb/testsuite/gdb.cp/cp-relocate.exp
+++ b/gdb/testsuite/gdb.cp/cp-relocate.exp
@@ -30,7 +30,7 @@ proc get_func_address { func } {
set rfunc [string_to_regexp $func]
gdb_test_multiple "print ${func}" "get address of ${func}" {
- -re "\\\$\[0-9\]+ = \\{.*\\} (($hex) <${rfunc}.*>)\[\r\n\]+${gdb_prompt} $" {
+ -re "${::valnum_re} = \\{.*\\} (($hex) <${rfunc}.*>)\[\r\n\]+${gdb_prompt} $" {
# $1 = {int ()} 0x24 <function_bar>
# But if the function is at zero, the name may be omitted.
pass "get address of ${func}"
diff --git a/gdb/testsuite/gdb.cp/ctti.exp b/gdb/testsuite/gdb.cp/ctti.exp
index 941143c81b7..e328b7c59c4 100644
--- a/gdb/testsuite/gdb.cp/ctti.exp
+++ b/gdb/testsuite/gdb.cp/ctti.exp
@@ -37,12 +37,12 @@ if {![runto_main]} {
gdb_breakpoint [gdb_get_line_number "marker add1"]
gdb_continue_to_breakpoint "marker add1"
-gdb_test "print c" "\\$\[0-9\]+ = 194 .*"
-gdb_test "print f" "\\$\[0-9\]+ = 9"
-gdb_test "print i" "\\$\[0-9\]+ = 4"
+gdb_test "print c" "${::valnum_re} = 194 .*"
+gdb_test "print f" "${::valnum_re} = 9"
+gdb_test "print i" "${::valnum_re} = 4"
gdb_test_multiple "print add<int>(2,2)" "print add<int>(2,2)" {
- -re "\\$\[0-9\]+ = 4\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = 4\r\n$gdb_prompt $" {
pass "print add<int>(2,2)"
}
-re "No symbol \"add<int>\" in current context.\r\n$gdb_prompt $" {
@@ -52,7 +52,7 @@ gdb_test_multiple "print add<int>(2,2)" "print add<int>(2,2)" {
# Note: 2.25 and 4.5 are exactly representable in IEEE-ish formats
gdb_test_multiple "print add<float>(2.25,2.25)" "print add<float>(2.25,2.25)" {
- -re "\\$\[0-9\]+ = 4\\.5\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = 4\\.5\r\n$gdb_prompt $" {
pass "print add<float>(2.25,2.25)"
}
-re "No symbol \"add<float>\" in current context.\r\n$gdb_prompt $" {
@@ -61,7 +61,7 @@ gdb_test_multiple "print add<float>(2.25,2.25)" "print add<float>(2.25,2.25)" {
}
gdb_test_multiple "print add<unsigned char>('A','A')" "print add<unsigned char>('A','A')" {
- -re "\\$\[0-9\]+ = 130 .*\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = 130 .*\r\n$gdb_prompt $" {
pass "print add<unsigned char>('A','A')"
}
-re "No symbol \"add<unsigned char>\" in current context.\r\n$gdb_prompt $" {
@@ -70,7 +70,7 @@ gdb_test_multiple "print add<unsigned char>('A','A')" "print add<unsigned char>(
}
gdb_test_multiple "print add2<int>(2,2)" "print add2<int>(2,2)" {
- -re "\\$\[0-9\]+ = 4\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = 4\r\n$gdb_prompt $" {
pass "print add2<int>(2,2)"
}
-re "No symbol \"add2<int>\" in current context.\r\n$gdb_prompt $" {
@@ -79,7 +79,7 @@ gdb_test_multiple "print add2<int>(2,2)" "print add2<int>(2,2)" {
}
gdb_test_multiple "print add2<float>(2.25,2.25)" "print add2<float>(2.25,2.25)" {
- -re "\\$\[0-9\]+ = 4\\.5\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = 4\\.5\r\n$gdb_prompt $" {
pass "print add2<float>(2.25,2.25)"
}
-re "No symbol \"add2<float>\" in current context.\r\n$gdb_prompt $" {
@@ -88,7 +88,7 @@ gdb_test_multiple "print add2<float>(2.25,2.25)" "print add2<float>(2.25,2.25)"
}
gdb_test_multiple "print add2<unsigned char>('A','A')" "print add2<unsigned char>('A','A')" {
- -re "\\$\[0-9]+ = 130 .*$gdb_prompt $" {
+ -re "${::valnum_re} = 130 .*$gdb_prompt $" {
pass "print add2<unsigned char>('A','A')"
}
-re "No symbol \"add2<unsigned char>\" in current context.\r\n$gdb_prompt $" {
@@ -97,7 +97,7 @@ gdb_test_multiple "print add2<unsigned char>('A','A')" "print add2<unsigned char
}
gdb_test_multiple "print add3<int>(2,2)" "print add3<int>(2,2)" {
- -re "\\$\[0-9\]+ = 4\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = 4\r\n$gdb_prompt $" {
pass "print add3<int>(2,2)"
}
-re "No symbol \"add3<int>\" in current context.\r\n$gdb_prompt $" {
@@ -106,7 +106,7 @@ gdb_test_multiple "print add3<int>(2,2)" "print add3<int>(2,2)" {
}
gdb_test_multiple "print add3<float>(2.25,2.25)" "print add3<float>(2.25,2.25)" {
- -re "\\$\[0-9\]+ = 4\\.5\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = 4\\.5\r\n$gdb_prompt $" {
pass "print add3<float>(2.25,2.25)"
}
-re "No symbol \"add3<float>\" in current context.\r\n$gdb_prompt $" {
@@ -115,7 +115,7 @@ gdb_test_multiple "print add3<float>(2.25,2.25)" "print add3<float>(2.25,2.25)"
}
gdb_test_multiple "print add3<unsigned char>('A','A')" "print add3<unsigned char>('A','A')" {
- -re "\\$\[0-9]+ = 130 .*$gdb_prompt $" {
+ -re "${::valnum_re} = 130 .*$gdb_prompt $" {
pass "print add3<unsigned char>('A','A')"
}
-re "No symbol \"add3<unsigned char>\" in current context.\r\n$gdb_prompt $" {
@@ -124,7 +124,7 @@ gdb_test_multiple "print add3<unsigned char>('A','A')" "print add3<unsigned char
}
gdb_test_multiple "print add4<int>(2,2)" "print add4<int>(2,2)" {
- -re "\\$\[0-9\]+ = 4\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = 4\r\n$gdb_prompt $" {
pass "print add4<int>(2,2)"
}
-re "No symbol \"add4<int>\" in current context.\r\n$gdb_prompt $" {
@@ -133,7 +133,7 @@ gdb_test_multiple "print add4<int>(2,2)" "print add4<int>(2,2)" {
}
gdb_test_multiple "print add4<float>(2.25,2.25)" "print add4<float>(2.25,2.25)" {
- -re "\\$\[0-9\]+ = 4\\.5\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = 4\\.5\r\n$gdb_prompt $" {
pass "print add4<float>(2.25,2.25)"
}
-re "No symbol \"add4<float>\" in current context.\r\n$gdb_prompt $" {
@@ -142,7 +142,7 @@ gdb_test_multiple "print add4<float>(2.25,2.25)" "print add4<float>(2.25,2.25)"
}
gdb_test_multiple "print add4<unsigned char>('A','A')" "print add4<unsigned char>('A','A')" {
- -re "\\$\[0-9]+ = 130 .*$gdb_prompt $" {
+ -re "${::valnum_re} = 130 .*$gdb_prompt $" {
pass "print add4<unsigned char>('A','A')"
}
-re "No symbol \"add4<unsigned char>\" in current context.\r\n$gdb_prompt $" {
diff --git a/gdb/testsuite/gdb.cp/derivation.exp b/gdb/testsuite/gdb.cp/derivation.exp
index 1e727a7cc82..34fbf3c250e 100644
--- a/gdb/testsuite/gdb.cp/derivation.exp
+++ b/gdb/testsuite/gdb.cp/derivation.exp
@@ -74,7 +74,7 @@ gdb_test "up" ".*main.*" "up from marker1"
# class A
-gdb_test "print a_instance" "\\$\[0-9\]+ = \{a = 1, aa = 2\}" "print value of a_instance"
+gdb_test "print a_instance" "${::valnum_re} = \{a = 1, aa = 2\}" "print value of a_instance"
# Clang does not add accessibility information for typedefs inside classes.
if {[test_compiler_info {clang*} c++]} {
@@ -94,7 +94,7 @@ cp_test_ptype_class \
# class D
gdb_test_multiple "print d_instance" "print value of d_instance" {
- -re "\\$\[0-9\]+ = \{<(class A|A)> = \{a = 1, aa = 2\}, <(class B|B)> = \{b = 3, bb = 4\}, <(class C|C)> = \{c = 5, cc = 6\}, d = 7, dd = 8\}$nl$gdb_prompt $" {
+ -re "${::valnum_re} = \{<(class A|A)> = \{a = 1, aa = 2\}, <(class B|B)> = \{b = 3, bb = 4\}, <(class C|C)> = \{c = 5, cc = 6\}, d = 7, dd = 8\}$nl$gdb_prompt $" {
pass "print value of d_instance"
}
}
@@ -119,7 +119,7 @@ cp_test_ptype_class \
# class E
gdb_test_multiple "print e_instance" "print value of e_instance" {
- -re "\\$\[0-9\]+ = \{<(class A|A)> = \{a = 1, aa = 2\}, <(class B|B)> = \{b = 3, bb = 4\}, <(class C|C)> = \{c = 5, cc = 6\}, e = 9, ee = 10\}$nl$gdb_prompt $" {
+ -re "${::valnum_re} = \{<(class A|A)> = \{a = 1, aa = 2\}, <(class B|B)> = \{b = 3, bb = 4\}, <(class C|C)> = \{c = 5, cc = 6\}, e = 9, ee = 10\}$nl$gdb_prompt $" {
pass "print value of e_instance"
}
}
@@ -144,7 +144,7 @@ cp_test_ptype_class \
# class F
gdb_test_multiple "print f_instance" "print value of f_instance" {
- -re "\\$\[0-9\]+ = \{<(class A|A)> = \{a = 1, aa = 2\}, <(class B|B)> = \{b = 3, bb = 4\}, <(class C|C)> = \{c = 5, cc = 6\}, f = 11, ff = 12\}$nl$gdb_prompt $" {
+ -re "${::valnum_re} = \{<(class A|A)> = \{a = 1, aa = 2\}, <(class B|B)> = \{b = 3, bb = 4\}, <(class C|C)> = \{c = 5, cc = 6\}, f = 11, ff = 12\}$nl$gdb_prompt $" {
pass "print value of f_instance"
}
}
@@ -180,25 +180,25 @@ cp_test_ptype_class \
# Print individual fields.
-gdb_test "print d_instance.a" "\\$\[0-9\]+ = 1" "print value of d_instance.a"
-gdb_test "print d_instance.aa" "\\$\[0-9\]+ = 2" "print value of d_instance.aa"
-gdb_test "print d_instance.b" "\\$\[0-9\]+ = 3" "print value of d_instance.b"
-gdb_test "print d_instance.bb" "\\$\[0-9\]+ = 4" "print value of d_instance.bb"
-gdb_test "print d_instance.c" "\\$\[0-9\]+ = 5" "print value of d_instance.c"
-gdb_test "print d_instance.cc" "\\$\[0-9\]+ = 6" "print value of d_instance.cc"
-gdb_test "print d_instance.d" "\\$\[0-9\]+ = 7" "print value of d_instance.d"
-gdb_test "print d_instance.dd" "\\$\[0-9\]+ = 8" "print value of d_instance.dd"
+gdb_test "print d_instance.a" "${::valnum_re} = 1" "print value of d_instance.a"
+gdb_test "print d_instance.aa" "${::valnum_re} = 2" "print value of d_instance.aa"
+gdb_test "print d_instance.b" "${::valnum_re} = 3" "print value of d_instance.b"
+gdb_test "print d_instance.bb" "${::valnum_re} = 4" "print value of d_instance.bb"
+gdb_test "print d_instance.c" "${::valnum_re} = 5" "print value of d_instance.c"
+gdb_test "print d_instance.cc" "${::valnum_re} = 6" "print value of d_instance.cc"
+gdb_test "print d_instance.d" "${::valnum_re} = 7" "print value of d_instance.d"
+gdb_test "print d_instance.dd" "${::valnum_re} = 8" "print value of d_instance.dd"
# Print some fields which are defined in the top of class G
# and in its base classes. This is not be ambiguous.
-gdb_test "print g_instance.a" "\\$\[0-9\]+ = 15" "print value of g_instance.a"
-gdb_test "print g_instance.b" "\\$\[0-9\]+ = 16" "print value of g_instance.b"
-gdb_test "print g_instance.c" "\\$\[0-9\]+ = 17" "print value of g_instance.c"
+gdb_test "print g_instance.a" "${::valnum_re} = 15" "print value of g_instance.a"
+gdb_test "print g_instance.b" "${::valnum_re} = 16" "print value of g_instance.b"
+gdb_test "print g_instance.c" "${::valnum_re} = 17" "print value of g_instance.c"
# Print a function call.
-gdb_test "print g_instance.afoo()" "\\$\[0-9\]+ = 1" "print value of g_instance.afoo()"
+gdb_test "print g_instance.afoo()" "${::valnum_re} = 1" "print value of g_instance.afoo()"
# If GDB fails to restore the selected frame properly after the
# inferior function call above (see GDB PR 1155 for an explanation of
@@ -218,8 +218,8 @@ gdb_test_multiple "frame" "re-selected 'main' frame after inferior call" {
}
}
-gdb_test "print g_instance.bfoo()" "\\$\[0-9\]+ = 2" "print value of g_instance.bfoo()"
-gdb_test "print g_instance.cfoo()" "\\$\[0-9\]+ = 3" "print value of g_instance.cfoo()"
+gdb_test "print g_instance.bfoo()" "${::valnum_re} = 2" "print value of g_instance.bfoo()"
+gdb_test "print g_instance.cfoo()" "${::valnum_re} = 3" "print value of g_instance.cfoo()"
# Check typedefs of fields
foreach Klass {"C" "G"} {
diff --git a/gdb/testsuite/gdb.cp/formatted-ref.exp b/gdb/testsuite/gdb.cp/formatted-ref.exp
index 3e4a76c1a8a..cecc3876b5a 100644
--- a/gdb/testsuite/gdb.cp/formatted-ref.exp
+++ b/gdb/testsuite/gdb.cp/formatted-ref.exp
@@ -41,7 +41,7 @@ proc get_address { var } {
global gdb_prompt
gdb_test_multiple "print &$var" "find address of $var" {
- -re "\\$\[0-9\]+ = \\(.*\\) (0x\[0-9a-f\]+).*$gdb_prompt $" {
+ -re "${::valnum_re} = \\(.*\\) (0x\[0-9a-f\]+).*$gdb_prompt $" {
return $expect_out(1,string)
}
timeout {
@@ -57,13 +57,13 @@ proc test_p_x { var type val addr } {
set test "print/x $var"
gdb_test_multiple $test $test {
- -re "\\$\[0-9\]+ = \\([string_to_regexp $type]\\) @0x\[a-f0-9\]+: [string_to_regexp $val].*$gdb_prompt $" {
+ -re "${::valnum_re} = \\([string_to_regexp $type]\\) @0x\[a-f0-9\]+: [string_to_regexp $val].*$gdb_prompt $" {
pass $test
}
- -re "\\$\[0-9\]+ = $addr.*$gdb_prompt $" {
+ -re "${::valnum_re} = $addr.*$gdb_prompt $" {
fail "$test (prints just address)"
}
- -re "\\$\[0-9\]+ = 0x\[a-f0-9\]+.*$gdb_prompt $" {
+ -re "${::valnum_re} = 0x\[a-f0-9\]+.*$gdb_prompt $" {
fail "$test (prints unexpected address)"
}
}
@@ -75,10 +75,10 @@ proc test_p_x_addr { var addr } {
set test "print/x &$var"
gdb_test_multiple $test $test {
- -re "\\$\[0-9\]+ = $addr.*$gdb_prompt $" {
+ -re "${::valnum_re} = $addr.*$gdb_prompt $" {
pass $test
}
- -re "\\$\[0-9\]+ = 0x\[a-f0-9+\]+.*$gdb_prompt $" {
+ -re "${::valnum_re} = 0x\[a-f0-9+\]+.*$gdb_prompt $" {
fail "$test (prints unexpected address)"
}
}
@@ -90,7 +90,7 @@ proc test_p_x_ref_addr { var addr } {
set test "print/x *(&(&$var))"
gdb_test_multiple $test $test {
- -re "\\$\[0-9\]+ = $addr.*$gdb_prompt $" {
+ -re "${::valnum_re} = $addr.*$gdb_prompt $" {
pass $test
}
-re "Attempt to take address of value not located in memory.*$gdb_prompt $" {
@@ -98,7 +98,7 @@ proc test_p_x_ref_addr { var addr } {
# correctly...
pass $test
}
- -re "\\$\[0-9\]+ = 0x\[a-f0-9+\]+.*$gdb_prompt $" {
+ -re "${::valnum_re} = 0x\[a-f0-9+\]+.*$gdb_prompt $" {
fail "$test (prints unexpected address)"
}
}
@@ -107,7 +107,7 @@ proc test_p_x_ref_addr { var addr } {
proc test_p_op1_equals_op2 {op1 op2} {
set test "print $op1 == $op2"
- gdb_test $test "\\$\[0-9\]+ = true"
+ gdb_test $test "${::valnum_re} = true"
}
runto ${srcfile}:[gdb_get_line_number "marker here"]
diff --git a/gdb/testsuite/gdb.cp/inherit.exp b/gdb/testsuite/gdb.cp/inherit.exp
index f3c7a23f4e2..eafec26828f 100644
--- a/gdb/testsuite/gdb.cp/inherit.exp
+++ b/gdb/testsuite/gdb.cp/inherit.exp
@@ -18,7 +18,7 @@
set ws "\[\r\n\t \]+"
set nl "\[\r\n\]+"
-set vhn "\\$\[0-9\]+"
+set vhn "${::valnum_re}"
require allow_cplus_tests
diff --git a/gdb/testsuite/gdb.cp/member-ptr.exp b/gdb/testsuite/gdb.cp/member-ptr.exp
index bce11019fd2..f7aa475d4f8 100644
--- a/gdb/testsuite/gdb.cp/member-ptr.exp
+++ b/gdb/testsuite/gdb.cp/member-ptr.exp
@@ -19,7 +19,7 @@
# Written by Satish Pai <pai@apollo.hp.com> 1997-08-19
# Rewritten by Michael Chastain <mec.gnu@mindspring.com> 2004-01-11
-set vhn "\\$\[0-9\]+"
+set vhn "${::valnum_re}"
require allow_cplus_tests
diff --git a/gdb/testsuite/gdb.cp/method-ref-return.exp b/gdb/testsuite/gdb.cp/method-ref-return.exp
index 2e75d5b6636..8f3638172c3 100644
--- a/gdb/testsuite/gdb.cp/method-ref-return.exp
+++ b/gdb/testsuite/gdb.cp/method-ref-return.exp
@@ -33,7 +33,7 @@ gdb_continue_to_breakpoint "after reference assignment"
# Test that we can call the method through reference and get the expected result.
gdb_test_multiple "print b.get_foo()" "print method call returning reference" {
- -re "\\$\[0-9\]+ = \\(const foo &\\) @$hex: \\{m_a = 42\\}\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = \\(const foo &\\) @$hex: \\{m_a = 42\\}\r\n$gdb_prompt $" {
pass $gdb_test_name
}
-re "Could not validate memory tag: Value can't be converted to integer\\." {
@@ -43,17 +43,17 @@ gdb_test_multiple "print b.get_foo()" "print method call returning reference" {
# Test accessing the member through the reference.
gdb_test "print b.get_foo ().m_a" \
- "\\$\[0-9\]+ = 42" \
+ "${::valnum_re} = 42" \
"print member access through reference"
# Test calling method on the referenced object.
gdb_test "print b.get_foo ().get_a()" \
- "\\$\[0-9\]+ = 42" \
+ "${::valnum_re} = 42" \
"print method call on referenced object"
# Test that the stored reference works correctly.
gdb_test_multiple "print ref" "print stored reference" {
- -re "\\$\[0-9\]+ = \\(const foo &\\) @$hex: \\{m_a = 42\\}\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = \\(const foo &\\) @$hex: \\{m_a = 42\\}\r\n$gdb_prompt $" {
pass $gdb_test_name
}
-re "Could not validate memory tag: Value can't be converted to integer\\." {
@@ -62,9 +62,9 @@ gdb_test_multiple "print ref" "print stored reference" {
}
gdb_test "print ref.m_a" \
- "\\$\[0-9\]+ = 42" \
+ "${::valnum_re} = 42" \
"print member through stored reference"
gdb_test "print ref.get_a()" \
- "\\$\[0-9\]+ = 42" \
+ "${::valnum_re} = 42" \
"print method call through stored reference"
\ No newline at end of file
diff --git a/gdb/testsuite/gdb.cp/namespace.exp b/gdb/testsuite/gdb.cp/namespace.exp
index 7ba3efb9ba4..5e9bee31239 100644
--- a/gdb/testsuite/gdb.cp/namespace.exp
+++ b/gdb/testsuite/gdb.cp/namespace.exp
@@ -72,7 +72,7 @@ gdb_test "print AAA::c" \
# An object declared using "using".
-gdb_test "print ina" "\\$\[0-9\]+ = {xx = 33}"
+gdb_test "print ina" "${::valnum_re} = {xx = 33}"
gdb_test_multiple "ptype ina" "ptype ina" {
-re "type = class (AAA::|)inA \{\r\n\[ \]*public:\r\n\[ \]*int xx;\r\n\[ \]*\r\n\[ \]*.*int fum\\(int\\);\r\n\}\r\n$gdb_prompt $" {
diff --git a/gdb/testsuite/gdb.cp/overload.exp b/gdb/testsuite/gdb.cp/overload.exp
index c017ae1a55e..5d586b19e24 100644
--- a/gdb/testsuite/gdb.cp/overload.exp
+++ b/gdb/testsuite/gdb.cp/overload.exp
@@ -87,7 +87,7 @@ set re_methods "${re_methods}${ws}int overloadargs\\(int, int, int, int, int, in
set re_methods "${re_methods}${ws}int overloadargs\\(int, int, int, int, int, int, int, int, int, int, int\\);"
set re_synth "foo & operator=\\(foo const ?&\\);"
-gdb_test "print foo_instance1" "\\$\[0-9\]+ = \{ifoo = 111, ccpfoo = 0x0\}"
+gdb_test "print foo_instance1" "${::valnum_re} = \{ifoo = 111, ccpfoo = 0x0\}"
set lines [gdb_get_lines "ptype foo_instance1"]
set test "ptype foo_instance1 output"
@@ -127,10 +127,10 @@ if { [regexp "^type = $re_class${ws}$XX_fields${ws}$re_synth${ws}$re_dtor${ws}$r
# Print variables and method calls.
# This is a walk in the park.
-gdb_test "print foo_instance2" "\\$\[0-9\]+ = \{ifoo = 222, ccpfoo = $hex \"A\"\}"
-gdb_test "print foo_instance3" "\\$\[0-9\]+ = \{ifoo = 222, ccpfoo = $hex \"A\"\}"
+gdb_test "print foo_instance2" "${::valnum_re} = \{ifoo = 222, ccpfoo = $hex \"A\"\}"
+gdb_test "print foo_instance3" "${::valnum_re} = \{ifoo = 222, ccpfoo = $hex \"A\"\}"
-gdb_test "print foo_instance1.overloadargs(1)" "\\$\[0-9\]+ = 1" \
+gdb_test "print foo_instance1.overloadargs(1)" "${::valnum_re} = 1" \
"print call overloaded func 1 arg"
# Regression test for overloading with function pointer type.
@@ -155,99 +155,99 @@ gdb_test_multiple "frame" "re-selected 'main' frame after inferior call" {
}
gdb_test "print foo_instance1.overloadargs(1, 2)" \
- "\\$\[0-9\]+ = 2" \
+ "${::valnum_re} = 2" \
"print call overloaded func 2 args"
gdb_test "print foo_instance1.overloadargs(1, 2, 3)" \
- "\\$\[0-9\]+ = 3" \
+ "${::valnum_re} = 3" \
"print call overloaded func 3 args"
gdb_test "print foo_instance1.overloadargs(1, 2, 3, 4)" \
- "\\$\[0-9\]+ = 4" \
+ "${::valnum_re} = 4" \
"print call overloaded func 4 args"
gdb_test "print foo_instance1.overloadargs(1, 2, 3, 4, 5)" \
- "\\$\[0-9\]+ = 5" \
+ "${::valnum_re} = 5" \
"print call overloaded func 5 args"
gdb_test "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6)" \
- "\\$\[0-9\]+ = 6" \
+ "${::valnum_re} = 6" \
"print call overloaded func 6 args"
gdb_test "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7)" \
- "\\$\[0-9\]+ = 7" \
+ "${::valnum_re} = 7" \
"print call overloaded func 7 args"
gdb_test "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8)" \
- "\\$\[0-9\]+ = 8" \
+ "${::valnum_re} = 8" \
"print call overloaded func 8 args"
gdb_test "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9)" \
- "\\$\[0-9\]+ = 9" \
+ "${::valnum_re} = 9" \
"print call overloaded func 9 args"
gdb_test "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)" \
- "\\$\[0-9\]+ = 10" \
+ "${::valnum_re} = 10" \
"print call overloaded func 10 args"
gdb_test "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)" \
- "\\$\[0-9\]+ = 11" \
+ "${::valnum_re} = 11" \
"print call overloaded func 11 args"
gdb_test "print foo_instance1.overload1arg()" \
- "\\$\[0-9\]+ = 1" \
+ "${::valnum_re} = 1" \
"print call overloaded func void arg"
gdb_test "print foo_instance1.overload1arg((char)arg2)" \
- "\\$\[0-9\]+ = 2" \
+ "${::valnum_re} = 2" \
"print call overloaded func char arg"
gdb_test "print foo_instance1.overload1arg((signed char)arg3)" \
- "\\$\[0-9\]+ = 3" \
+ "${::valnum_re} = 3" \
"print call overloaded func signed char arg"
gdb_test "print foo_instance1.overload1arg((unsigned char)arg4)" \
- "\\$\[0-9\]+ = 4" \
+ "${::valnum_re} = 4" \
"print call overloaded func unsigned char arg"
gdb_test "print foo_instance1.overload1arg((short)arg5)" \
- "\\$\[0-9\]+ = 5" \
+ "${::valnum_re} = 5" \
"print call overloaded func short arg"
gdb_test "print foo_instance1.overload1arg((unsigned short)arg6)" \
- "\\$\[0-9\]+ = 6" \
+ "${::valnum_re} = 6" \
"print call overloaded func unsigned short arg"
gdb_test "print foo_instance1.overload1arg((int)arg7)" \
- "\\$\[0-9\]+ = 7" \
+ "${::valnum_re} = 7" \
"print call overloaded func int arg"
gdb_test "print foo_instance1.overload1arg((unsigned int)arg8)" \
- "\\$\[0-9\]+ = 8" \
+ "${::valnum_re} = 8" \
"print call overloaded func unsigned int arg"
gdb_test "print foo_instance1.overload1arg((long)arg9)" \
- "\\$\[0-9\]+ = 9" \
+ "${::valnum_re} = 9" \
"print call overloaded func long arg"
gdb_test "print foo_instance1.overload1arg((unsigned long)arg10)" \
- "\\$\[0-9\]+ = 10" \
+ "${::valnum_re} = 10" \
"print call overloaded func unsigned long arg"
gdb_test "print foo_instance1.overload1arg((float)arg11)" \
- "\\$\[0-9\]+ = 11" \
+ "${::valnum_re} = 11" \
"print call overloaded func float arg"
gdb_test "print foo_instance1.overload1arg((double)arg12)" \
- "\\$\[0-9\]+ = 12" \
+ "${::valnum_re} = 12" \
"print call overloaded func double arg"
gdb_test "print foo_instance1.overload1arg(&arg13)" \
- "\\$\[0-9\]+ = 13" \
+ "${::valnum_re} = 13" \
"print call overloaded func int\\* arg"
gdb_test "print foo_instance1.overload1arg(&arg14)" \
- "\\$\[0-9\]+ = 14" \
+ "${::valnum_re} = 14" \
"print call overloaded func char\\* arg"
gdb_test "print bar(a)" "= 11"
@@ -366,7 +366,7 @@ gdb_test "print overloadNamespace(dummyInstance)" ".\[0-9\]* = 2" "print overloa
# One last mysterious test.
# I wonder what this is for?
-gdb_test "print intToChar(1)" "\\$\[0-9\]+ = 297"
+gdb_test "print intToChar(1)" "${::valnum_re} = 297"
# Test expression evaluation with overloaded methods
gdb_test "print foo::overload1arg" \
@@ -376,11 +376,11 @@ gdb_test "print foo::overload1arg(char***)" \
"no member function matches that type instantiation"
gdb_test "print foo::overload1arg(void)" \
- "\\$$decimal = {int \\(foo \\*( const|)\\)} $hex <foo::overload1arg\\(\\)>"
+ "${::valnum_re} = {int \\(foo \\*( const|)\\)} $hex <foo::overload1arg\\(\\)>"
foreach t [list char "signed char" "unsigned char" "short" \
"unsigned short" int "unsigned int" long "unsigned long" \
float double] {
gdb_test "print foo::overload1arg($t)" \
- "\\$$decimal = {int \\(foo \\*( const|), $t\\)} $hex <foo::overload1arg\\($t\\)>"
+ "${::valnum_re} = {int \\(foo \\*( const|), $t\\)} $hex <foo::overload1arg\\($t\\)>"
}
diff --git a/gdb/testsuite/gdb.cp/static-print-quit.exp b/gdb/testsuite/gdb.cp/static-print-quit.exp
index 7a26f4b9cd8..088abb9b9f8 100644
--- a/gdb/testsuite/gdb.cp/static-print-quit.exp
+++ b/gdb/testsuite/gdb.cp/static-print-quit.exp
@@ -28,7 +28,7 @@ gdb_test_no_output "set width 80"
gdb_test_no_output "set height 2"
gdb_test_multiple "print c" "" {
- -re "\\$\[0-9\]+ = \{loooooooooooooooooooooooooooooooooooooooooooooong = 0, static field = \{\r\n$pagination_prompt$" {
+ -re "${::valnum_re} = \{loooooooooooooooooooooooooooooooooooooooooooooong = 0, static field = \{\r\n$pagination_prompt$" {
pass $gdb_test_name
}
-re "\r\n$pagination_prompt$" {
diff --git a/gdb/testsuite/gdb.cp/virtfunc.exp b/gdb/testsuite/gdb.cp/virtfunc.exp
index ffacc77e6f4..21e300e4ffc 100644
--- a/gdb/testsuite/gdb.cp/virtfunc.exp
+++ b/gdb/testsuite/gdb.cp/virtfunc.exp
@@ -181,17 +181,17 @@ proc test_virtual_calls {} {
return 0
}
- gdb_test "print pAe->f()" "\\$\[0-9\]+ = 20"
- gdb_test "print pAa->f()" "\\$\[0-9\]+ = 1"
- gdb_test "print pDe->vg()" "\\$\[0-9\]+ = 202"
- gdb_test "print pADe->vg()" "\\$\[0-9\]+ = 202"
- gdb_test "print pDd->vg()" "\\$\[0-9\]+ = 101"
- gdb_test "print pEe->vvb()" "\\$\[0-9\]+ = 411"
- gdb_test "print pVB->vvb()" "\\$\[0-9\]+ = 407"
- gdb_test "print pBe->vvb()" "\\$\[0-9\]+ = 411"
- gdb_test "print pDe->vvb()" "\\$\[0-9\]+ = 411"
- gdb_test "print pEe->vd()" "\\$\[0-9\]+ = 282"
- gdb_test "print pEe->fvb()" "\\$\[0-9\]+ = 311"
+ gdb_test "print pAe->f()" "${::valnum_re} = 20"
+ gdb_test "print pAa->f()" "${::valnum_re} = 1"
+ gdb_test "print pDe->vg()" "${::valnum_re} = 202"
+ gdb_test "print pADe->vg()" "${::valnum_re} = 202"
+ gdb_test "print pDd->vg()" "${::valnum_re} = 101"
+ gdb_test "print pEe->vvb()" "${::valnum_re} = 411"
+ gdb_test "print pVB->vvb()" "${::valnum_re} = 407"
+ gdb_test "print pBe->vvb()" "${::valnum_re} = 411"
+ gdb_test "print pDe->vvb()" "${::valnum_re} = 411"
+ gdb_test "print pEe->vd()" "${::valnum_re} = 282"
+ gdb_test "print pEe->fvb()" "${::valnum_re} = 311"
# more recent results:
# wrong value "202"
@@ -204,10 +204,10 @@ proc test_virtual_calls {} {
# -- chastain 2003-12-31
gdb_test_multiple "print pEe->D::vg()" "print pEe->D::vg()" {
- -re "\\$\[0-9]+ = 102$nl$gdb_prompt $" {
+ -re "${::valnum_re} = 102$nl$gdb_prompt $" {
pass "print pEe->D::vg()"
}
- -re "\\$\[0-9]+ = 202$nl$gdb_prompt $" {
+ -re "${::valnum_re} = 202$nl$gdb_prompt $" {
# To get this result, we have called pEe->*(&D::vg) ().
# That's how GDB interprets this, but it's wrong; in fact
# the explicit D:: means to bypass virtual function lookup,
diff --git a/gdb/testsuite/gdb.cp/virtfunc2.exp b/gdb/testsuite/gdb.cp/virtfunc2.exp
index 598fe4304b3..761453f6227 100644
--- a/gdb/testsuite/gdb.cp/virtfunc2.exp
+++ b/gdb/testsuite/gdb.cp/virtfunc2.exp
@@ -37,12 +37,12 @@ if {![runto_main]} {
gdb_breakpoint [gdb_get_line_number "marker 1"]
gdb_continue_to_breakpoint "marker 1"
-gdb_test "print o.do_print()" "\\$\[0-9\]+ = 123456"
-gdb_test "print o.do_print3()" "\\$\[0-9\]+ = 111111"
+gdb_test "print o.do_print()" "${::valnum_re} = 123456"
+gdb_test "print o.do_print3()" "${::valnum_re} = 111111"
-gdb_test "print o2.do_print()" "\\$\[0-9\]+ = 123456"
-gdb_test "print o2.do_print2()" "\\$\[0-9\]+ = 654321"
-gdb_test "print o2.do_print3()" "\\$\[0-9\]+ = 111111"
+gdb_test "print o2.do_print()" "${::valnum_re} = 123456"
+gdb_test "print o2.do_print2()" "${::valnum_re} = 654321"
+gdb_test "print o2.do_print3()" "${::valnum_re} = 111111"
gdb_test "print o" " = {<interface> = {.*_vptr.interface = $hex <vtable for Obj.*>}, <No data fields>}"
diff --git a/gdb/testsuite/gdb.fortran/debug-expr.exp b/gdb/testsuite/gdb.fortran/debug-expr.exp
index 638624b3438..4cd78c7d478 100644
--- a/gdb/testsuite/gdb.fortran/debug-expr.exp
+++ b/gdb/testsuite/gdb.fortran/debug-expr.exp
@@ -36,12 +36,12 @@ gdb_breakpoint [gdb_get_line_number "Break Here"]
gdb_continue_to_breakpoint "Break Here"
gdb_test_no_output "set debug expression 1"
-gdb_test_debug_expr "print obj%three(1)%two(1)%one(1)%i" "\\\$$decimal = 1"
+gdb_test_debug_expr "print obj%three(1)%two(1)%one(1)%i" "${::valnum_re} = 1"
gdb_test_debug_expr "print .TRUE." [multi_line \
"Operation: OP_BOOL" \
" Constant: .*1" \
- "\\\$$decimal = \.TRUE\."]
+ "${::valnum_re} = \.TRUE\."]
gdb_test_debug_expr "print .FALSE." [multi_line \
"Operation: OP_BOOL" \
" Constant: .*0" \
- "\\\$$decimal = \.FALSE\."]
+ "${::valnum_re} = \.FALSE\."]
diff --git a/gdb/testsuite/gdb.fortran/derived-type.exp b/gdb/testsuite/gdb.fortran/derived-type.exp
index 6e05b3229f4..c55ebb338e2 100644
--- a/gdb/testsuite/gdb.fortran/derived-type.exp
+++ b/gdb/testsuite/gdb.fortran/derived-type.exp
@@ -52,25 +52,25 @@ gdb_test_multiple "ptype q" $test {
gdb_breakpoint [gdb_get_line_number "print"]
gdb_continue_to_breakpoint "print"
-gdb_test "print p" "\\$\[0-9\]+ = \\( c = 1, d = 2\\.375 \\)"
-gdb_test "print p%c" "\\$\[0-9\]+ = 1"
-gdb_test "print p%d" "\\$\[0-9\]+ = 2\\.375"
-gdb_test "print q%a" "\\$\[0-9\]+ = 3\\.125"
+gdb_test "print p" "${::valnum_re} = \\( c = 1, d = 2\\.375 \\)"
+gdb_test "print p%c" "${::valnum_re} = 1"
+gdb_test "print p%d" "${::valnum_re} = 2\\.375"
+gdb_test "print q%a" "${::valnum_re} = 3\\.125"
set test "print q%b"
gdb_test_multiple $test $test {
- -re "\\$\[0-9\]+ = 'abcdefg'\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = 'abcdefg'\r\n$gdb_prompt $" {
pass $test
}
- -re "\\$\[0-9\]+ = \\(97 'a', 98 'b', 99 'c', 100 'd', 101 'e', 102 'f', 103 'g'\\)\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = \\(97 'a', 98 'b', 99 'c', 100 'd', 101 'e', 102 'f', 103 'g'\\)\r\n$gdb_prompt $" {
# Compiler should produce string, not an array of characters.
setup_xfail "*-*-*"
fail $test
}
}
-gdb_test "print q%x%c" "\\$\[0-9\]+ = 1"
-gdb_test "print q%x%d" "\\$\[0-9\]+ = 2\\.375"
+gdb_test "print q%x%c" "${::valnum_re} = 1"
+gdb_test "print q%x%d" "${::valnum_re} = 2\\.375"
set result_line "= \\( a = 3.125, x = \\( c = 1, d = 2\\.375 \\),\
b = 'abcdefg' \\)\r\n$gdb_prompt $"
diff --git a/gdb/testsuite/gdb.fortran/namelist.exp b/gdb/testsuite/gdb.fortran/namelist.exp
index 3f60fb1475d..25c9ae920a6 100644
--- a/gdb/testsuite/gdb.fortran/namelist.exp
+++ b/gdb/testsuite/gdb.fortran/namelist.exp
@@ -44,7 +44,7 @@ if { $supported } {
gdb_test "ptype nml" \
"type = Type nml\r\n *$int :: a\r\n *$int :: b\r\n *End Type nml"
gdb_test "print nml" \
- "\\$\[0-9\]+ = \\( a = 10, b = 20 \\)"
+ "${::valnum_re} = \\( a = 10, b = 20 \\)"
} else {
gdb_test "ptype nml" \
"No symbol \"nml\" in current context\\."
diff --git a/gdb/testsuite/gdb.fortran/subarray.exp b/gdb/testsuite/gdb.fortran/subarray.exp
index 9bd4698050c..f8677168b33 100644
--- a/gdb/testsuite/gdb.fortran/subarray.exp
+++ b/gdb/testsuite/gdb.fortran/subarray.exp
@@ -48,10 +48,10 @@ gdb_test "continue" \
set test "print str(2:4)"
gdb_test_multiple $test $test {
- -re "\\$\[0-9\]+ = 'bcd'\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = 'bcd'\r\n$gdb_prompt $" {
pass $test
}
- -re "\\$\[0-9\]+ = \\(98 'b', 99 'c', 100 'd'\\)\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = \\(98 'b', 99 'c', 100 'd'\\)\r\n$gdb_prompt $" {
# Compiler should produce string, not an array of characters.
setup_xfail "*-*-*"
fail $test
@@ -60,10 +60,10 @@ gdb_test_multiple $test $test {
set test "print str(:3)"
gdb_test_multiple $test $test {
- -re "\\$\[0-9\]+ = 'abc'\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = 'abc'\r\n$gdb_prompt $" {
pass $test
}
- -re "\\$\[0-9\]+ = \\(97 'a', 98 'b', 99 'c'\\)\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = \\(97 'a', 98 'b', 99 'c'\\)\r\n$gdb_prompt $" {
# Compiler should produce string, not an array of characters.
setup_xfail "*-*-*"
fail $test
@@ -72,10 +72,10 @@ gdb_test_multiple $test $test {
set test "print str(5:)"
gdb_test_multiple $test $test {
- -re "\\$\[0-9\]+ = 'efg'\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = 'efg'\r\n$gdb_prompt $" {
pass $test
}
- -re "\\$\[0-9\]+ = \\(101 'e', 102 'f', 103 'g'\\)\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = \\(101 'e', 102 'f', 103 'g'\\)\r\n$gdb_prompt $" {
# Compiler should produce string, not an array of characters.
setup_xfail "*-*-*"
fail $test
@@ -84,17 +84,17 @@ gdb_test_multiple $test $test {
set test "print str(:)"
gdb_test_multiple $test $test {
- -re "\\$\[0-9\]+ = 'abcdefg'\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = 'abcdefg'\r\n$gdb_prompt $" {
pass $test
}
- -re "\\$\[0-9\]+ = \\(97 'a', 98 'b', 99 'c', 100 'd', 101 'e', 102 'f', 103 'g'\\)\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = \\(97 'a', 98 'b', 99 'c', 100 'd', 101 'e', 102 'f', 103 'g'\\)\r\n$gdb_prompt $" {
# Compiler should produce string, not an array of characters.
setup_xfail "*-*-*"
fail $test
}
}
-gdb_test "print array(2:4)" "\\$\[0-9\]+ = \\(2, 3, 4\\)"
-gdb_test "print array(:3)" "\\$\[0-9\]+ = \\(1, 2, 3\\)"
-gdb_test "print array(5:)" "\\$\[0-9\]+ = \\(5, 6, 7\\)"
-gdb_test "print array(:)" "\\$\[0-9\]+ = \\(1, 2, 3, 4, 5, 6, 7\\)"
+gdb_test "print array(2:4)" "${::valnum_re} = \\(2, 3, 4\\)"
+gdb_test "print array(:3)" "${::valnum_re} = \\(1, 2, 3\\)"
+gdb_test "print array(5:)" "${::valnum_re} = \\(5, 6, 7\\)"
+gdb_test "print array(:)" "${::valnum_re} = \\(1, 2, 3, 4, 5, 6, 7\\)"
diff --git a/gdb/testsuite/gdb.mi/user-selected-context-sync.exp b/gdb/testsuite/gdb.mi/user-selected-context-sync.exp
index 3434ffa2a46..844206f7511 100644
--- a/gdb/testsuite/gdb.mi/user-selected-context-sync.exp
+++ b/gdb/testsuite/gdb.mi/user-selected-context-sync.exp
@@ -485,7 +485,7 @@ proc ensure_no_output { test } {
if { $gdb_spawn_id == $gdb_main_spawn_id } {
# CLI
gdb_test "print 666" \
- "^\\\$$decimal = 666" \
+ "^${::valnum_re} = 666" \
"$test, ensure no output CLI"
} elseif { $gdb_spawn_id == $mi_spawn_id } {
# MI
diff --git a/gdb/testsuite/gdb.multi/tids.exp b/gdb/testsuite/gdb.multi/tids.exp
index 2d843a05f5d..be42fcbffd0 100644
--- a/gdb/testsuite/gdb.multi/tids.exp
+++ b/gdb/testsuite/gdb.multi/tids.exp
@@ -43,7 +43,7 @@ proc thread_apply {tid_list exp_tid_list {message ""}} {
foreach tid $expected {
append r "\[\r\n\]+"
append r "Thread $tid $any:\r\n"
- append r "\\$$decimal = 1234"
+ append r "${::valnum_re} = 1234"
}
set cmd "thread apply $tid_list"
diff --git a/gdb/testsuite/gdb.opt/clobbered-registers-O2.exp b/gdb/testsuite/gdb.opt/clobbered-registers-O2.exp
index 72eceb8b91d..f36bb62a78a 100644
--- a/gdb/testsuite/gdb.opt/clobbered-registers-O2.exp
+++ b/gdb/testsuite/gdb.opt/clobbered-registers-O2.exp
@@ -33,11 +33,11 @@ if {![runto start_sequence]} {
gdb_test "frame 1" "#1.*in gen_movsd.*" "backtracing"
gdb_test_multiple "print operand0" "print operand0" {
- -re "\\\$$decimal = <optimized out>\r\n$gdb_prompt $" { pass "print operand0"}
+ -re "${::valnum_re} = <optimized out>\r\n$gdb_prompt $" { pass "print operand0"}
-re "$hex\r\n$gdb_prompt $" { gdb_test "print *operand0" "13" "print operand0" }
}
gdb_test_multiple "print operand1" "print operand1" {
- -re "\\\$$decimal = <optimized out>\r\n$gdb_prompt $" { pass "print operand1"}
+ -re "${::valnum_re} = <optimized out>\r\n$gdb_prompt $" { pass "print operand1"}
-re "$hex\r\n$gdb_prompt $" { gdb_test "print *operand1" "14" "print operand1" }
}
diff --git a/gdb/testsuite/gdb.opt/inline-cmds.exp b/gdb/testsuite/gdb.opt/inline-cmds.exp
index 8f1005adf36..12db0709fe6 100644
--- a/gdb/testsuite/gdb.opt/inline-cmds.exp
+++ b/gdb/testsuite/gdb.opt/inline-cmds.exp
@@ -107,7 +107,7 @@ gdb_test_multiple "list" $msg {
# func1_step above).
set x_val -1
gdb_test_multiple "print x" "" {
- -re "\\\$$decimal = (\[0-9\]*)\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = (\[0-9\]*)\r\n$gdb_prompt $" {
set x_val $expect_out(1,string)
}
-re "$gdb_prompt $" { }
diff --git a/gdb/testsuite/gdb.opt/inline-locals.exp b/gdb/testsuite/gdb.opt/inline-locals.exp
index a2671648b3b..2c3a9f71c2f 100644
--- a/gdb/testsuite/gdb.opt/inline-locals.exp
+++ b/gdb/testsuite/gdb.opt/inline-locals.exp
@@ -74,7 +74,7 @@ if { ! $no_frames } {
# Make sure that locals on the stack are found. This is an array to
# prevent it from living in a register.
-gdb_test "print array\[0\]" "\\\$$decimal = 0" "print local 2"
+gdb_test "print array\[0\]" "${::valnum_re} = 0" "print local 2"
if { ! $no_frames } {
# Verify that we do not print out variables from the inlined
@@ -122,7 +122,7 @@ if { ! $no_frames } {
gdb_test "info locals" ".*arg2 = 184.*" "info locals above bar (3b)"
}
-gdb_test "print array\[0\]" "\\\$$decimal = 184" "print local 3"
+gdb_test "print array\[0\]" "${::valnum_re} = 184" "print local 3"
# Test printing scoped local variables.
diff --git a/gdb/testsuite/gdb.opt/static-optimized-out.exp b/gdb/testsuite/gdb.opt/static-optimized-out.exp
index 6b2a94e6760..92a5d2836d6 100644
--- a/gdb/testsuite/gdb.opt/static-optimized-out.exp
+++ b/gdb/testsuite/gdb.opt/static-optimized-out.exp
@@ -29,7 +29,7 @@ if { [prepare_for_testing "failed to prepare" $testfile \
set val ""
gdb_test_multiple "print aaa" "" {
- -re -wrap "^(?:\\$$decimal = )?(.*)" {
+ -re -wrap "^(?:${::valnum_re} = )?(.*)" {
set val $expect_out(1,string)
}
}
diff --git a/gdb/testsuite/gdb.server/ext-wrapper.exp b/gdb/testsuite/gdb.server/ext-wrapper.exp
index ad4dd660228..836c32a7574 100644
--- a/gdb/testsuite/gdb.server/ext-wrapper.exp
+++ b/gdb/testsuite/gdb.server/ext-wrapper.exp
@@ -49,7 +49,7 @@ gdb_test_no_output "set remote exec-file $target_exec" "set remote exec-file"
gdb_breakpoint marker
gdb_test "run" "Breakpoint.* marker .*" "run to marker"
-gdb_test "print d" "\\$${decimal} = ${hex} \"1\".*"
+gdb_test "print d" "${::valnum_re} = ${hex} \"1\".*"
# Restart the process.
with_test_prefix "restart" {
@@ -71,7 +71,7 @@ with_test_prefix "restart" {
}
}
- gdb_test "print d" "\\$${decimal} = ${hex} \"1\".*"
+ gdb_test "print d" "${::valnum_re} = ${hex} \"1\".*"
}
gdb_test "kill" "" "kill" "Kill the program being debugged. .y or n. " "y"
diff --git a/gdb/testsuite/gdb.server/inferior-args.exp b/gdb/testsuite/gdb.server/inferior-args.exp
index a9244dbed70..312e756f0d8 100644
--- a/gdb/testsuite/gdb.server/inferior-args.exp
+++ b/gdb/testsuite/gdb.server/inferior-args.exp
@@ -93,12 +93,12 @@ proc do_test_inner { extended_p with_shell_p escape_p arglist re_list } {
set expected_len [expr {1 + [llength $re_list]}]
gdb_test "print argc" \
- "\\\$$::decimal = $expected_len" "check argc"
+ "${::valnum_re} = $expected_len" "check argc"
set i 1
foreach arg $re_list {
gdb_test "print argv\[$i\]" \
- "\\\$$::decimal = $::hex \"$arg\"" \
+ "${::valnum_re} = $::hex \"$arg\"" \
"check argv\[$i\]"
incr i
}
diff --git a/gdb/testsuite/gdb.server/wrapper.exp b/gdb/testsuite/gdb.server/wrapper.exp
index d577f29f744..9478640c40e 100644
--- a/gdb/testsuite/gdb.server/wrapper.exp
+++ b/gdb/testsuite/gdb.server/wrapper.exp
@@ -57,4 +57,4 @@ gdb_breakpoint marker
gdb_test "continue" "Breakpoint.* marker .*" "continue to marker"
# Test env var TEST is correctly passed to the program through
# --wrapper.
-gdb_test "print d" "\\$${decimal} = ${hex} \"1\".*"
+gdb_test "print d" "${::valnum_re} = ${hex} \"1\".*"
diff --git a/gdb/testsuite/gdb.threads/infcall-thread-announce.exp b/gdb/testsuite/gdb.threads/infcall-thread-announce.exp
index 17f233a099c..311daaca87c 100644
--- a/gdb/testsuite/gdb.threads/infcall-thread-announce.exp
+++ b/gdb/testsuite/gdb.threads/infcall-thread-announce.exp
@@ -36,7 +36,7 @@ proc check_thread_count { adjustment } {
incr ::thr_count $adjustment
gdb_test "p \$_inferior_thread_count" \
- "^\\\$$::decimal = $::thr_count"
+ "^${::valnum_re} = $::thr_count"
}
with_test_prefix "starting threads" {
@@ -47,7 +47,7 @@ with_test_prefix "starting threads" {
foreach_with_prefix call_type { print call } {
gdb_test "$call_type start_thread()" \
- "\\\[New Thread \[^\r\n\]+\\\]\r\n\\\$$decimal = 1" \
+ "\\\[New Thread \[^\r\n\]+\\\]\r\n${::valnum_re} = 1" \
"start another new thread"
check_thread_count +1
}
@@ -61,7 +61,7 @@ with_test_prefix "stopping threads" {
foreach_with_prefix call_type { print call } {
gdb_test "$call_type stop_thread()" \
- "\\\[Thread \[^\r\n\]+ exited\\\]\r\n\\\$$decimal = 1" \
+ "\\\[Thread \[^\r\n\]+ exited\\\]\r\n${::valnum_re} = 1" \
"stop another thread"
check_thread_count -1
}
diff --git a/gdb/testsuite/gdb.threads/pthreads.exp b/gdb/testsuite/gdb.threads/pthreads.exp
index 9f2d04e2a51..d54e3ecf433 100644
--- a/gdb/testsuite/gdb.threads/pthreads.exp
+++ b/gdb/testsuite/gdb.threads/pthreads.exp
@@ -305,11 +305,11 @@ proc check_qcs {} {
"" \
"Thread $::thread2_id ${any}" \
"#${number}${ws}${any} in thread2 ${any}" \
- "\\\$\[0-9]+ = ${number}${any}" \
+ "${::valnum_re} = ${number}${any}" \
"" \
"Thread $::thread1_id ${any}" \
"#${number}${ws}${any} in thread1 ${any}" \
- "\\\$\[0-9]+ = ${number}${any}" \
+ "${::valnum_re} = ${number}${any}" \
] \
"run a failing command except in one frame of thread 2,3, -s to silently continue"
}
@@ -319,16 +319,16 @@ proc check_qcs {} {
gdb_test "thread apply all -s -q frame apply all -s p i" \
[multi_line \
"#${number}${ws}${any} in thread2 ${any}" \
- "\\\$\[0-9]+ = ${number}${any}" \
+ "${::valnum_re} = ${number}${any}" \
"#${number}${ws}${any} in thread1 ${any}" \
- "\\\$\[0-9]+ = ${number}${any}" \
+ "${::valnum_re} = ${number}${any}" \
] \
"run a failing command except in one frame of thread 2,3, -s to silently continue. Do not show thread information"
gdb_test "thread apply all -s -q frame apply all -s -q p i" \
[multi_line \
- "\\\$\[0-9]+ = ${number}${any}" \
- "\\\$\[0-9]+ = ${number}${any}" \
+ "${::valnum_re} = ${number}${any}" \
+ "${::valnum_re} = ${number}${any}" \
] \
"run a failing command except in one frame of thread 2,3, -s to silently continue. Do not show thread and frame info"
diff --git a/gdb/testsuite/gdb.threads/reconnect-signal.exp b/gdb/testsuite/gdb.threads/reconnect-signal.exp
index a33d31103f7..bbd5e651b7f 100644
--- a/gdb/testsuite/gdb.threads/reconnect-signal.exp
+++ b/gdb/testsuite/gdb.threads/reconnect-signal.exp
@@ -46,7 +46,7 @@ gdb_test "info threads" "\\* 2 .*" "thread 2 is selected"
set msg "save \$pc after signal"
set saved_pc ""
gdb_test_multiple "print/x \$pc" $msg {
- -re "\\\$$decimal = (\[^\r\n\]*)\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = (\[^\r\n\]*)\r\n$gdb_prompt $" {
set saved_pc $expect_out(1,string)
pass $msg
}
@@ -74,7 +74,7 @@ if { [lindex $res 0] == 0 } {
gdb_test "info threads" "\\* 2 .*" "thread 2 is selected on reconnect"
# Check that the program is still alive, and stopped in the same spot.
-gdb_test "print/x \$pc" "\\\$$decimal = $saved_pc" "check \$pc after signal"
+gdb_test "print/x \$pc" "${::valnum_re} = $saved_pc" "check \$pc after signal"
# Check that we didn't lose the signal.
gdb_test "info program" "stopped with signal SIGUSR1,.*"
diff --git a/gdb/testsuite/gdb.threads/schedlock.exp b/gdb/testsuite/gdb.threads/schedlock.exp
index 7c50aebd545..3f3da91947a 100644
--- a/gdb/testsuite/gdb.threads/schedlock.exp
+++ b/gdb/testsuite/gdb.threads/schedlock.exp
@@ -47,7 +47,7 @@ proc get_args { description } {
set test "listed args, $description"
gdb_test_multiple "print args" $test {
- -re "\\\$\[0-9\]+ = {$pattern}.*$gdb_prompt $" {
+ -re "${::valnum_re} = {$pattern}.*$gdb_prompt $" {
pass $test
set result ""
diff --git a/gdb/testsuite/gdb.threads/thread-bp-deleted.exp b/gdb/testsuite/gdb.threads/thread-bp-deleted.exp
index e3a5b3df7d4..037e8288b62 100644
--- a/gdb/testsuite/gdb.threads/thread-bp-deleted.exp
+++ b/gdb/testsuite/gdb.threads/thread-bp-deleted.exp
@@ -190,7 +190,7 @@ gdb_test_lines "maint info breakpoints" "" ".*" \
# Set the do_spin variable in the inferior. This will cause it to drop out
# of its spin loop and hit the next breakpoint. Remember, at this point the
# inferior is still executing.
-gdb_test "print do_spin = 0" "\\\$$decimal = 0"
+gdb_test "print do_spin = 0" "${::valnum_re} = 0"
# Collect the notification that the inferior has stopped.
gdb_test_multiple "" "wait for stop" {
diff --git a/gdb/testsuite/gdb.threads/threadapply.exp b/gdb/testsuite/gdb.threads/threadapply.exp
index a2fde0b0305..73b61056a19 100644
--- a/gdb/testsuite/gdb.threads/threadapply.exp
+++ b/gdb/testsuite/gdb.threads/threadapply.exp
@@ -55,13 +55,13 @@ gdb_test_multiple "define backthread" "defining macro" {
# verify that the macro can get past the backtrace error and perform
# subsequent commands.
gdb_test_no_output "set backtrace limit 3"
-gdb_test "thread apply all backthread" "Thread ..*\\\$\[0-9]+ = 0x14.*Thread ..*\\\$\[0-9]+ = 0x14.*Thread ..*\\\$\[0-9]+ = 0x14.*Thread ..*\\\$\[0-9]+ = 0x14.*Thread ..*\\\$\[0-9]+ = 0x14.*Thread ..*\\\$\[0-9]+ = 0x14"
+gdb_test "thread apply all backthread" "Thread ..*${::valnum_re} = 0x14.*Thread ..*${::valnum_re} = 0x14.*Thread ..*${::valnum_re} = 0x14.*Thread ..*${::valnum_re} = 0x14.*Thread ..*${::valnum_re} = 0x14.*Thread ..*${::valnum_re} = 0x14"
# Go into the thread_function to check that a simple "thread apply"
# does not change the selected frame.
gdb_test "step" "thread_function.*" "step to the thread_function"
gdb_test "up" ".*in main.*" "go up in the stack frame"
-gdb_test "thread apply all print 1" "Thread ..*\\\$\[0-9]+ = 1.*Thread ..*\\\$\[0-9]+ = 1.*Thread ..*\\\$\[0-9]+ = 1.*Thread ..*\\\$\[0-9]+ = 1.*Thread ..*\\\$\[0-9]+ = 1.*Thread ..*\\\$\[0-9]+ = 1" "run a simple print command on all threads"
+gdb_test "thread apply all print 1" "Thread ..*${::valnum_re} = 1.*Thread ..*${::valnum_re} = 1.*Thread ..*${::valnum_re} = 1.*Thread ..*${::valnum_re} = 1.*Thread ..*${::valnum_re} = 1.*Thread ..*${::valnum_re} = 1" "run a simple print command on all threads"
gdb_test "down" "#0.*thread_function.*" "go down and check selected frame"
# Make sure that GDB doesn't crash when the previously selected thread
diff --git a/gdb/testsuite/gdb.threads/tls-core.exp b/gdb/testsuite/gdb.threads/tls-core.exp
index 95aba7b3b17..e59f22b2454 100644
--- a/gdb/testsuite/gdb.threads/tls-core.exp
+++ b/gdb/testsuite/gdb.threads/tls-core.exp
@@ -60,7 +60,7 @@ proc tls_core_test {supported corefile} {
if {![string match $host_triplet $target_triplet]} {
setup_kfail "threads/22381" "*-*-*"
}
- gdb_test "p/x foo" "\\$\[0-9]+ = 0xdeadbeef" $test
+ gdb_test "p/x foo" "${::valnum_re} = 0xdeadbeef" $test
} else {
unsupported $test
}
diff --git a/gdb/testsuite/gdb.trace/collection.exp b/gdb/testsuite/gdb.trace/collection.exp
index 0b2c8cfe617..2ddfd210f0f 100644
--- a/gdb/testsuite/gdb.trace/collection.exp
+++ b/gdb/testsuite/gdb.trace/collection.exp
@@ -43,10 +43,10 @@ proc test_register { reg test_id } {
global gdb_prompt
gdb_test_multiple "print /x $reg" "" {
- -re "\\$\[0-9\]+ = \[x0\]+\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = \[x0\]+\r\n$gdb_prompt $" {
fail "collect $test_id: collected $reg (zero)"
}
- -re "\\$\[0-9\]+ = \[x0-9a-fA-F\]+\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = \[x0-9a-fA-F\]+\r\n$gdb_prompt $" {
pass "collect $test_id: collected $reg"
}
-re "\[Ee\]rror.*$gdb_prompt $" {
@@ -129,30 +129,30 @@ proc gdb_collect_args_test { myargs msg } {
}
gdb_test "print argc" \
- "\\$\[0-9\]+ = 1 '.001'" \
+ "${::valnum_re} = 1 '.001'" \
"collected arg char"
gdb_test "print argi" \
- "\\$\[0-9\]+ = 2" \
+ "${::valnum_re} = 2" \
"collected arg int"
gdb_test "print argf" \
- "\\$\[0-9\]+ = 3.\[23\]\[0-9\]*" \
+ "${::valnum_re} = 3.\[23\]\[0-9\]*" \
"collected arg float"
gdb_test "print argd" \
- "\\$\[0-9\]+ = 4.\[34\]\[0-9\]*" \
+ "${::valnum_re} = 4.\[34\]\[0-9\]*" \
"collected arg double"
# struct arg as one of several args (near end of list)
gdb_test "print argstruct.memberc" \
- "\\$\[0-9\]+ = 101 'e'" \
+ "${::valnum_re} = 101 'e'" \
"collected arg struct member char"
gdb_test "print argstruct.memberi" \
- "\\$\[0-9\]+ = 102" \
+ "${::valnum_re} = 102" \
"collected arg struct member int"
gdb_test "print argstruct.memberf" \
- "\\$\[0-9\]+ = 103.\[23\]\[0-9\]*" \
+ "${::valnum_re} = 103.\[23\]\[0-9\]*" \
"collected arg struct member float"
gdb_test "print argstruct.memberd" \
- "\\$\[0-9\]+ = 104.\[34\]\[0-9\]*" \
+ "${::valnum_re} = 104.\[34\]\[0-9\]*" \
"collected arg struct member double"
# array arg as one of several args (near end of list)
@@ -166,22 +166,22 @@ proc gdb_collect_args_test { myargs msg } {
setup_xfail "*-*-*"
gdb_test "print argarray\[0\]" \
- "\\$\[0-9\]+ = 111" \
+ "${::valnum_re} = 111" \
"collected argarray #0"
setup_xfail "*-*-*"
gdb_test "print argarray\[1\]" \
- "\\$\[0-9\]+ = 112" \
+ "${::valnum_re} = 112" \
"collected argarray #1"
setup_xfail "*-*-*"
gdb_test "print argarray\[2\]" \
- "\\$\[0-9\]+ = 113" \
+ "${::valnum_re} = 113" \
"collected argarray #2"
setup_xfail "*-*-*"
gdb_test "print argarray\[3\]" \
- "\\$\[0-9\]+ = 114" \
+ "${::valnum_re} = 114" \
"collected argarray #3"
gdb_test "tfind none" \
@@ -208,16 +208,16 @@ proc gdb_collect_argstruct_test { myargs msg } {
# struct argument as only argument
gdb_test "print argstruct.memberc" \
- "\\$\[0-9\]+ = 101 'e'" \
+ "${::valnum_re} = 101 'e'" \
"collected arg struct member char"
gdb_test "print argstruct.memberi" \
- "\\$\[0-9\]+ = 102" \
+ "${::valnum_re} = 102" \
"collected arg struct member int"
gdb_test "print argstruct.memberf" \
- "\\$\[0-9\]+ = 103.\[23\]\[0-9\]*" \
+ "${::valnum_re} = 103.\[23\]\[0-9\]*" \
"collected arg struct member float"
gdb_test "print argstruct.memberd" \
- "\\$\[0-9\]+ = 104.\[34\]\[0-9\]*" \
+ "${::valnum_re} = 104.\[34\]\[0-9\]*" \
"collected arg struct member double"
gdb_test "tfind none" \
@@ -255,22 +255,22 @@ proc gdb_collect_argarray_test { myargs msg } {
setup_xfail "*-*-*"
gdb_test "print argarray\[0\]" \
- "\\$\[0-9\]+ = 111" \
+ "${::valnum_re} = 111" \
"collected argarray #0"
setup_xfail "*-*-*"
gdb_test "print argarray\[1\]" \
- "\\$\[0-9\]+ = 112" \
+ "${::valnum_re} = 112" \
"collected argarray #1"
setup_xfail "*-*-*"
gdb_test "print argarray\[2\]" \
- "\\$\[0-9\]+ = 113" \
+ "${::valnum_re} = 113" \
"collected argarray #2"
setup_xfail "*-*-*"
gdb_test "print argarray\[3\]" \
- "\\$\[0-9\]+ = 114" \
+ "${::valnum_re} = 114" \
"collected argarray #3"
gdb_test "tfind none" \
@@ -314,42 +314,42 @@ proc gdb_collect_locals_test { func mylocs msg } {
run_trace_experiment $func
gdb_test "print locc" \
- "\\$\[0-9\]+ = 11 '.\[a-z0-7\]+'" \
+ "${::valnum_re} = 11 '.\[a-z0-7\]+'" \
"collected local char"
gdb_test "print loci" \
- "\\$\[0-9\]+ = 12" \
+ "${::valnum_re} = 12" \
"collected local int"
gdb_test "print locf" \
- "\\$\[0-9\]+ = 13.\[23\]\[0-9\]*" \
+ "${::valnum_re} = 13.\[23\]\[0-9\]*" \
"collected local float"
gdb_test "print locd" \
- "\\$\[0-9\]+ = 14.\[34\]\[0-9\]*" \
+ "${::valnum_re} = 14.\[34\]\[0-9\]*" \
"collected local double"
gdb_test "print locst.memberc" \
- "\\$\[0-9\]+ = 15 '.017'" \
+ "${::valnum_re} = 15 '.017'" \
"collected local member char"
gdb_test "print locst.memberi" \
- "\\$\[0-9\]+ = 16" \
+ "${::valnum_re} = 16" \
"collected local member int"
gdb_test "print locst.memberf" \
- "\\$\[0-9\]+ = 17.\[67\]\[0-9\]*" \
+ "${::valnum_re} = 17.\[67\]\[0-9\]*" \
"collected local member float"
gdb_test "print locst.memberd" \
- "\\$\[0-9\]+ = 18.\[78\]\[0-9\]*" \
+ "${::valnum_re} = 18.\[78\]\[0-9\]*" \
"collected local member double"
gdb_test "print locar\[0\]" \
- "\\$\[0-9\]+ = 121" \
+ "${::valnum_re} = 121" \
"collected locarray #0"
gdb_test "print locar\[1\]" \
- "\\$\[0-9\]+ = 122" \
+ "${::valnum_re} = 122" \
"collected locarray #1"
gdb_test "print locar\[2\]" \
- "\\$\[0-9\]+ = 123" \
+ "${::valnum_re} = 123" \
"collected locarray #2"
gdb_test "print locar\[3\]" \
- "\\$\[0-9\]+ = 124" \
+ "${::valnum_re} = 124" \
"collected locarray #3"
gdb_test "tfind none" \
@@ -422,7 +422,7 @@ proc gdb_collect_expression_test { func expr val msg } {
run_trace_experiment $func
gdb_test "print $expr" \
- "\\$\[0-9\]+ = $val" \
+ "${::valnum_re} = $val" \
"got expected value '$val'"
gdb_test "tfind none" \
@@ -483,49 +483,49 @@ proc gdb_collect_globals_test { } {
run_trace_experiment globals_test_func
gdb_test "print globalc" \
- "\\$\[0-9\]+ = 71 'G'" \
+ "${::valnum_re} = 71 'G'" \
"collected global char"
gdb_test "print globali" \
- "\\$\[0-9\]+ = 72" \
+ "${::valnum_re} = 72" \
"collected global int"
gdb_test "print globalf" \
- "\\$\[0-9\]+ = 73.\[23\]\[0-9\]*" \
+ "${::valnum_re} = 73.\[23\]\[0-9\]*" \
"collected global float"
gdb_test "print globald" \
- "\\$\[0-9\]+ = 74.\[34\]\[0-9\]*" \
+ "${::valnum_re} = 74.\[34\]\[0-9\]*" \
"collected global double"
gdb_test "print globalstruct.memberc" \
- "\\$\[0-9\]+ = 81 'Q'" \
+ "${::valnum_re} = 81 'Q'" \
"collected struct char member"
gdb_test "print globalstruct.memberi" \
- "\\$\[0-9\]+ = 82" \
+ "${::valnum_re} = 82" \
"collected struct member int"
gdb_test "print globalstruct.memberf" \
- "\\$\[0-9\]+ = 83.\[23\]\[0-9\]*" \
+ "${::valnum_re} = 83.\[23\]\[0-9\]*" \
"collected struct member float"
gdb_test "print globalstruct.memberd" \
- "\\$\[0-9\]+ = 84.\[34\]\[0-9\]*" \
+ "${::valnum_re} = 84.\[34\]\[0-9\]*" \
"collected struct member double"
gdb_test "print globalp == &globalstruct" \
- "\\$\[0-9\]+ = 1" \
+ "${::valnum_re} = 1" \
"collected global pointer"
gdb_test "print globalarr\[1\]" \
- "\\$\[0-9\]+ = 1" \
+ "${::valnum_re} = 1" \
"collected global array element #1"
gdb_test "print globalarr\[2\]" \
- "\\$\[0-9\]+ = 2" \
+ "${::valnum_re} = 2" \
"collected global array element #2"
gdb_test "print globalarr\[3\]" \
- "\\$\[0-9\]+ = 3" \
+ "${::valnum_re} = 3" \
"collected global array element #3"
# Check that we didn't mess up sort&merging memory ranges to
# collect.
gdb_test "print globalarr2" \
- "\\$\[0-9\]+ = \\{0, 1, 2, 3\\}" \
+ "${::valnum_re} = \\{0, 1, 2, 3\\}" \
"collected global array 2"
# GDB would internal error collecting UNOP_MEMVAL's whose address
@@ -533,7 +533,7 @@ proc gdb_collect_globals_test { } {
# corresponding 'collect' action above). This just double checks
# we actually did collect what we wanted.
gdb_test "print globalarr3" \
- "\\$\[0-9\]+ = \\{3, 2, 1, 0\\}" \
+ "${::valnum_re} = \\{3, 2, 1, 0\\}" \
"collect globals: collected global array 3"
gdb_test "tfind none" \
@@ -656,7 +656,7 @@ proc gdb_collect_strings_test { func mystr myrslt mylim msg } {
run_trace_experiment $func
gdb_test "print $mystr" \
- "\\$\[0-9\]+ = $hex \"$myrslt\".*" \
+ "${::valnum_re} = $hex \"$myrslt\".*" \
"collected local string"
gdb_test "tfind none" \
diff --git a/gdb/testsuite/gdb.trace/disconnected-tracing.exp b/gdb/testsuite/gdb.trace/disconnected-tracing.exp
index 87d64e8f9f0..2b34c0a2378 100644
--- a/gdb/testsuite/gdb.trace/disconnected-tracing.exp
+++ b/gdb/testsuite/gdb.trace/disconnected-tracing.exp
@@ -127,18 +127,18 @@ proc disconnected_tfind { } {
gdb_test_no_output "tstop"
gdb_test "tfind" "Found trace frame 0, tracepoint .*" "tfind frame 0"
- gdb_test "p \$trace_frame" ".*\\\$${decimal} = 0.*" \
+ gdb_test "p \$trace_frame" ".*${::valnum_re} = 0.*" \
"p \$trace_frame before disconnected"
- gdb_test "p \$tracepoint" ".*\\\$${decimal} = 2.*" \
+ gdb_test "p \$tracepoint" ".*${::valnum_re} = 2.*" \
"p \$tracepoint before disconnected"
gdb_test "disconnect" "Ending remote debugging\\." "first disconnect"
- gdb_test "p \$trace_frame" ".*\\\$${decimal} = -1.*"
- gdb_test "p \$tracepoint" ".*\\\$${decimal} = -1.*"
- gdb_test "p \$trace_line" ".*\\\$${decimal} = -1.*"
- gdb_test "p \$trace_file" ".*\\\$${decimal} = void.*"
- gdb_test "p \$trace_func" ".*\\\$${decimal} = void.*"
+ gdb_test "p \$trace_frame" ".*${::valnum_re} = -1.*"
+ gdb_test "p \$tracepoint" ".*${::valnum_re} = -1.*"
+ gdb_test "p \$trace_line" ".*${::valnum_re} = -1.*"
+ gdb_test "p \$trace_file" ".*${::valnum_re} = void.*"
+ gdb_test "p \$trace_func" ".*${::valnum_re} = void.*"
}
}
diff --git a/gdb/testsuite/gdb.trace/report.exp b/gdb/testsuite/gdb.trace/report.exp
index 55416d71376..57aac880333 100644
--- a/gdb/testsuite/gdb.trace/report.exp
+++ b/gdb/testsuite/gdb.trace/report.exp
@@ -265,10 +265,10 @@ proc use_collected_data { data_source } {
"11.3: test \$trace_line"
gdb_test_multiple "print \$trace_file" "11.4: test \$trace_file" {
- -re "\\$\[0-9\]+ = \"$srcfile\"\[\r\n\]+$gdb_prompt $" {
+ -re "${::valnum_re} = \"$srcfile\"\[\r\n\]+$gdb_prompt $" {
pass "11.4: test \$trace_file"
}
- -re "\\$\[0-9\]+ = \"$srcdir/$subdir/$srcfile\"\[\r\n\]+$gdb_prompt $" {
+ -re "${::valnum_re} = \"$srcdir/$subdir/$srcfile\"\[\r\n\]+$gdb_prompt $" {
pass "11.4: test \$trace_file"
}
}
diff --git a/gdb/testsuite/gdb.trace/stap-trace.exp b/gdb/testsuite/gdb.trace/stap-trace.exp
index cfdfbe15ee5..3742c4d25f3 100644
--- a/gdb/testsuite/gdb.trace/stap-trace.exp
+++ b/gdb/testsuite/gdb.trace/stap-trace.exp
@@ -95,7 +95,7 @@ proc gdb_collect_probe_arg { msg probe val_arg0 } {
run_trace_experiment $msg $probe
gdb_test "print \$_probe_arg0" \
- "\\$\[0-9\]+ = $val_arg0" \
+ "${::valnum_re} = $val_arg0" \
"collect $msg: collected probe arg0"
}
diff --git a/gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp b/gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp
index 4f8449c7d96..39b71b35877 100644
--- a/gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp
+++ b/gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp
@@ -312,9 +312,9 @@ with_test_prefix "tracing foo" {
gdb_test_no_output "tstop"
gdb_test "tfind 0" "Found trace frame 0, tracepoint .*"
- gdb_test "p/d x" "\\\$${decimal} = {a = 0, b = 0, c = <unavailable>}"
- gdb_test "p/d y" "\\\$${decimal} = {a = 0, b = <unavailable>, c = 0}"
- gdb_test "p/d z" "\\\$${decimal} = {a = <unavailable>, b = 0, c = 0}"
+ gdb_test "p/d x" "${::valnum_re} = {a = 0, b = 0, c = <unavailable>}"
+ gdb_test "p/d y" "${::valnum_re} = {a = 0, b = <unavailable>, c = 0}"
+ gdb_test "p/d z" "${::valnum_re} = {a = <unavailable>, b = 0, c = 0}"
gdb_test "tfind none" "No longer looking at any trace frame.*"
}
@@ -329,13 +329,13 @@ with_test_prefix "tracing bar" {
gdb_test "tfind 0" "Found trace frame 0, tracepoint .*"
if { $endian == "little" } {
- gdb_test "p/d x" "\\\$${decimal} = {a = 0, b = <unavailable>, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0}"
- gdb_test "p/d y" "\\\$${decimal} = {a = 0, b = 0, c = 0, d = 0, e = <unavailable>, f = 0, g = 0, h = 0, i = 0, j = 0}"
- gdb_test "p/d z" "\\\$${decimal} = {a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = <unavailable>, j = 0}"
+ gdb_test "p/d x" "${::valnum_re} = {a = 0, b = <unavailable>, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0}"
+ gdb_test "p/d y" "${::valnum_re} = {a = 0, b = 0, c = 0, d = 0, e = <unavailable>, f = 0, g = 0, h = 0, i = 0, j = 0}"
+ gdb_test "p/d z" "${::valnum_re} = {a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = <unavailable>, j = 0}"
} else {
- gdb_test "p/d x" "\\\$${decimal} = {a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = <unavailable>, j = 0}"
- gdb_test "p/d y" "\\\$${decimal} = {a = 0, b = 0, c = 0, d = 0, e = 0, f = <unavailable>, g = 0, h = 0, i = 0, j = 0}"
- gdb_test "p/d z" "\\\$${decimal} = {a = 0, b = <unavailable>, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0}"
+ gdb_test "p/d x" "${::valnum_re} = {a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = <unavailable>, j = 0}"
+ gdb_test "p/d y" "${::valnum_re} = {a = 0, b = 0, c = 0, d = 0, e = 0, f = <unavailable>, g = 0, h = 0, i = 0, j = 0}"
+ gdb_test "p/d z" "${::valnum_re} = {a = 0, b = <unavailable>, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0}"
}
gdb_test "tfind none" "No longer looking at any trace frame.*"
diff --git a/gdb/testsuite/gdb.trace/unavailable.exp b/gdb/testsuite/gdb.trace/unavailable.exp
index 8e00334af85..5d4309f3750 100644
--- a/gdb/testsuite/gdb.trace/unavailable.exp
+++ b/gdb/testsuite/gdb.trace/unavailable.exp
@@ -34,10 +34,10 @@ proc test_register { reg } {
global hex
gdb_test_multiple "print /x $reg" "collected $reg" {
- -re "\\$\[0-9\]+ = \[x0\]+\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = \[x0\]+\r\n$gdb_prompt $" {
fail "collected $reg (zero)"
}
- -re "\\$\[0-9\]+ = $hex\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = $hex\r\n$gdb_prompt $" {
pass "collected $reg"
}
-re "\[Ee\]rror.*$gdb_prompt $" {
@@ -514,7 +514,7 @@ proc gdb_collect_globals_test_1 { } {
"global reference shows address but not value"
gdb_test "print *&g_ref" \
- "\\$\[0-9\]+ = <unavailable>" \
+ "${::valnum_re} = <unavailable>" \
"referenced integer was not collected (taking address of reference)"
gdb_test "print *g_structref_p" " = <unavailable>"
@@ -536,7 +536,7 @@ proc gdb_collect_globals_test_1 { } {
# Incomplete strings print as an array.
gdb_test "print g_string_partial" \
- "\\$\[0-9\]+ = \{<unavailable>, 101 'e', 108 'l', <unavailable>, <unavailable>, <unavailable>, <unavailable>, <unavailable>, <unavailable>, <unavailable>, <unavailable>, <unavailable>\}" \
+ "${::valnum_re} = \{<unavailable>, 101 'e', 108 'l', <unavailable>, <unavailable>, <unavailable>, <unavailable>, <unavailable>, <unavailable>, <unavailable>, <unavailable>, <unavailable>\}" \
"printing partially collected string"
# It is important for this test that the last examined value is
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index acef1ad6310..f6bdfcdb60c 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -3503,7 +3503,7 @@ proc with_gdb_cwd { dir body } {
exp_continue
}
- -re "^\\\$$::decimal = 123\r\n" {
+ -re "^${::valnum_re} = 123\r\n" {
set saw_result true
exp_continue
}
@@ -9536,7 +9536,7 @@ proc get_var_address { var } {
# $6 = (int (*)()) 0x24 <function_bar>
gdb_test_multiple "print &${var}" "get address of ${var}" {
- -re "\\\$\[0-9\]+ = \\(.*\\) (0|$hex)( <${var}>)?\[\r\n\]+${gdb_prompt} $"
+ -re "${::valnum_re} = \\(.*\\) (0|$hex)( <${var}>)?\[\r\n\]+${gdb_prompt} $"
{
pass "get address of ${var}"
if { $expect_out(1,string) == "0" } {
--
2.51.0
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH 3/5] [gdb/testsuite] Use valnum_re more often (part 2)
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 ` Tom de Vries
2026-01-28 12:06 ` [PATCH 4/5] [gdb/testsuite] Use valnum_re more often (part 3) Tom de Vries
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Tom de Vries @ 2026-01-28 12:06 UTC (permalink / raw)
To: gdb-patches
Also transform '\\\$\[0-9\]*' into valnum_re, assuming that '\\\$\[0-9\]+' was
meant.
Done using these commands to cover '\\\$' vs '\\$' and '\[0-9\]' vs '\[0-9]':
...
$ find gdb/testsuite/ -type f -name *.exp* \
| xargs sed -i 's/\\\\\\$\\\[0-9\\\]\*/${::valnum_re}/g'
$ find gdb/testsuite/ -type f -name *.exp* \
| xargs sed -i 's/\\\\\\$\\\[0-9\]\*/${::valnum_re}/g'
$ find gdb/testsuite/ -type f -name *.exp* \
| xargs sed -i 's/\\\\$\\\[0-9\\\]\*/${::valnum_re}/g'
$ find gdb/testsuite/ -type f -name *.exp* \
| xargs sed -i 's/\\\\$\\\[0-9\]\*/${::valnum_re}/g'
...
---
.../gdb.arch/powerpc-plxv-nonrel.exp | 2 +-
.../gdb.base/break-main-file-remove-fail.exp | 2 +-
gdb/testsuite/gdb.base/complex.exp | 4 +-
gdb/testsuite/gdb.base/exprs.exp | 222 +++++++++---------
gdb/testsuite/gdb.base/gdb1090.exp | 4 +-
gdb/testsuite/gdb.base/offsets.exp | 4 +-
gdb/testsuite/gdb.base/readline.exp | 8 +-
gdb/testsuite/gdb.cp/anon-union.exp | 30 +--
gdb/testsuite/gdb.cp/m-data.exp | 26 +-
gdb/testsuite/gdb.cp/m-static.exp | 14 +-
gdb/testsuite/gdb.cp/method.exp | 18 +-
gdb/testsuite/gdb.cp/misc.exp | 42 ++--
gdb/testsuite/gdb.cp/namespace.exp | 16 +-
gdb/testsuite/gdb.cp/pr-574.exp | 2 +-
gdb/testsuite/gdb.cp/printmethod.exp | 4 +-
gdb/testsuite/gdb.cp/rtti.exp | 14 +-
gdb/testsuite/gdb.cp/templates.exp | 10 +-
gdb/testsuite/gdb.cp/userdef.exp | 64 ++---
gdb/testsuite/gdb.opt/fortran-string.exp | 2 +-
.../gdb.threads/continue-pending-status.exp | 2 +-
gdb/testsuite/lib/gdb.exp | 6 +-
gdb/testsuite/lib/mi-support.exp | 2 +-
22 files changed, 249 insertions(+), 249 deletions(-)
diff --git a/gdb/testsuite/gdb.arch/powerpc-plxv-nonrel.exp b/gdb/testsuite/gdb.arch/powerpc-plxv-nonrel.exp
index 9030e2c32e5..4f90080cf56 100644
--- a/gdb/testsuite/gdb.arch/powerpc-plxv-nonrel.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-plxv-nonrel.exp
@@ -45,7 +45,7 @@ proc get_vector_hexadecimal_valueof { exp default {test ""} } {
set test "get vector_hexadecimal valueof \"${exp}\""
}
gdb_test_multiple "print $${exp}.uint128" $test {
- -re -wrap "\\$\[0-9\]* = (0x\[0-9a-zA-Z\]+).*" {
+ -re -wrap "${::valnum_re} = (0x\[0-9a-zA-Z\]+).*" {
set val $expect_out(1,string)
pass "$test"
}
diff --git a/gdb/testsuite/gdb.base/break-main-file-remove-fail.exp b/gdb/testsuite/gdb.base/break-main-file-remove-fail.exp
index 00610b71107..face6205da7 100644
--- a/gdb/testsuite/gdb.base/break-main-file-remove-fail.exp
+++ b/gdb/testsuite/gdb.base/break-main-file-remove-fail.exp
@@ -100,7 +100,7 @@ proc test_remove_bp { initial_load } {
# get_integer_valueof.
set munmap -1
gdb_test_multiple "print /d ${munmap_expr}" "get result of munmap call" {
- -re -wrap "^(?:warning: error removing breakpoint $::decimal at $::hex\r\n)?\\$\[0-9\]* = (\[-\]*\[0-9\]*).*" {
+ -re -wrap "^(?:warning: error removing breakpoint $::decimal at $::hex\r\n)?${::valnum_re} = (\[-\]*\[0-9\]*).*" {
set munmap $expect_out(1,string)
pass $gdb_test_name
}
diff --git a/gdb/testsuite/gdb.base/complex.exp b/gdb/testsuite/gdb.base/complex.exp
index 5096e585ee1..c4be874e376 100644
--- a/gdb/testsuite/gdb.base/complex.exp
+++ b/gdb/testsuite/gdb.base/complex.exp
@@ -25,11 +25,11 @@ if {[runto f2]} {
if {[test_compiler_info gcc-2-*] && [test_debug_format "DWARF \[0-9\]"]} {
setup_xfail "*-*-*"
}
- gdb_test "p *y" "\\\$\[0-9\]* = \{c = 42 '\\*', f = 1 \\+ 0i\}" \
+ gdb_test "p *y" "${::valnum_re} = \{c = 42 '\\*', f = 1 \\+ 0i\}" \
"print complex packed value in C"
}
if {[runto f4]} {
- gdb_test "p *y" "\\\$\[0-9\]* = \{c = 42 '\\*', f = 1 \\+ 0i\}" \
+ gdb_test "p *y" "${::valnum_re} = \{c = 42 '\\*', f = 1 \\+ 0i\}" \
"print complex value in C"
}
diff --git a/gdb/testsuite/gdb.base/exprs.exp b/gdb/testsuite/gdb.base/exprs.exp
index 32f7cc85149..ba5ce80a535 100644
--- a/gdb/testsuite/gdb.base/exprs.exp
+++ b/gdb/testsuite/gdb.base/exprs.exp
@@ -51,142 +51,142 @@ proc test_expr { args } {
#
# test expressions with "char" types
#
-test_expr "set variable v_char=127" "print v_char == 0" "\\$\[0-9\]* = $false" "print v_char == 127" "\\$\[0-9\]* = $true" "print char =="
-test_expr "set variable v_char=127" "print v_char != 0" "\\$\[0-9\]* = $true" "print v_char != 127" "\\$\[0-9\]* = $false" "print char !="
-test_expr "set variable v_char=127" "print v_char < 0" "\\$\[0-9\]* = $false" "print v_char < 127" "\\$\[0-9\]* = $false" "print char <"
-test_expr "set variable v_char=127" "print v_char > 0" "\\$\[0-9\]* = $true" "print v_char > 127" "\\$\[0-9\]* = $false" "print char >"
+test_expr "set variable v_char=127" "print v_char == 0" "${::valnum_re} = $false" "print v_char == 127" "${::valnum_re} = $true" "print char =="
+test_expr "set variable v_char=127" "print v_char != 0" "${::valnum_re} = $true" "print v_char != 127" "${::valnum_re} = $false" "print char !="
+test_expr "set variable v_char=127" "print v_char < 0" "${::valnum_re} = $false" "print v_char < 127" "${::valnum_re} = $false" "print char <"
+test_expr "set variable v_char=127" "print v_char > 0" "${::valnum_re} = $true" "print v_char > 127" "${::valnum_re} = $false" "print char >"
#
# test expressions with "signed char" types
#
-test_expr "set variable v_signed_char=127" "print v_signed_char == 0" "\\$\[0-9\]* = $false" "print v_signed_char == 127" "\\$\[0-9\]* = $true" "print signed char =="
-test_expr "set variable v_signed_char=127" "print v_signed_char != 0" "\\$\[0-9\]* = $true" "print v_signed_char != 127" "\\$\[0-9\]* = $false" "print signed char !="
-test_expr "set variable v_signed_char=127" "print v_signed_char < 0" "\\$\[0-9\]* = $false" "print v_signed_char < 127" "\\$\[0-9\]* = $false" "print signed char <"
-test_expr "set variable v_signed_char=127" "print v_signed_char > 0" "\\$\[0-9\]* = $true" "print v_signed_char > 127" "\\$\[0-9\]* = $false" "print signed char >"
+test_expr "set variable v_signed_char=127" "print v_signed_char == 0" "${::valnum_re} = $false" "print v_signed_char == 127" "${::valnum_re} = $true" "print signed char =="
+test_expr "set variable v_signed_char=127" "print v_signed_char != 0" "${::valnum_re} = $true" "print v_signed_char != 127" "${::valnum_re} = $false" "print signed char !="
+test_expr "set variable v_signed_char=127" "print v_signed_char < 0" "${::valnum_re} = $false" "print v_signed_char < 127" "${::valnum_re} = $false" "print signed char <"
+test_expr "set variable v_signed_char=127" "print v_signed_char > 0" "${::valnum_re} = $true" "print v_signed_char > 127" "${::valnum_re} = $false" "print signed char >"
# make char a minus
-test_expr "set variable v_signed_char=-1" "print v_signed_char == 0" "\\$\[0-9\]* = $false" "print v_signed_char == -1" "\\$\[0-9\]* = $true" "print signed char == (minus)"
-test_expr "set variable v_signed_char=-1" "print v_signed_char != 0" "\\$\[0-9\]* = $true" "print v_signed_char != -1" "\\$\[0-9\]* = $false" "print signed char != (minus)"
-test_expr "set variable v_signed_char=-1" "print v_signed_char < 0" "\\$\[0-9\]* = $true" "print v_signed_char < 127" "\\$\[0-9\]* = $true" "print signed char < (minus)"
-test_expr "set variable v_signed_char=-1" "print v_signed_char > 0" "\\$\[0-9\]* = $false" "print v_signed_char > 127" "\\$\[0-9\]* = $false" "print signed char > (minus)"
+test_expr "set variable v_signed_char=-1" "print v_signed_char == 0" "${::valnum_re} = $false" "print v_signed_char == -1" "${::valnum_re} = $true" "print signed char == (minus)"
+test_expr "set variable v_signed_char=-1" "print v_signed_char != 0" "${::valnum_re} = $true" "print v_signed_char != -1" "${::valnum_re} = $false" "print signed char != (minus)"
+test_expr "set variable v_signed_char=-1" "print v_signed_char < 0" "${::valnum_re} = $true" "print v_signed_char < 127" "${::valnum_re} = $true" "print signed char < (minus)"
+test_expr "set variable v_signed_char=-1" "print v_signed_char > 0" "${::valnum_re} = $false" "print v_signed_char > 127" "${::valnum_re} = $false" "print signed char > (minus)"
#
# test expressions with "unsigned char" types
#
-test_expr "set variable v_unsigned_char=127" "print v_unsigned_char == 0" "\\$\[0-9\]* = $false" "print v_unsigned_char == 127" "\\$\[0-9\]* = $true" "print unsigned char =="
-test_expr "set variable v_unsigned_char=127" "print v_unsigned_char != 0" "\\$\[0-9\]* = $true" "print v_unsigned_char != 127" "\\$\[0-9\]* = $false" "print unsigned char !="
-test_expr "set variable v_unsigned_char=127" "print v_unsigned_char < 0" "\\$\[0-9\]* = $false" "print v_unsigned_char < 127" "\\$\[0-9\]* = $false" "print unsigned char <"
-test_expr "set variable v_unsigned_char=127" "print v_unsigned_char > 0" "\\$\[0-9\]* = $true" "print v_unsigned_char > 127" "\\$\[0-9\]* = $false" "print unsigned char >"
+test_expr "set variable v_unsigned_char=127" "print v_unsigned_char == 0" "${::valnum_re} = $false" "print v_unsigned_char == 127" "${::valnum_re} = $true" "print unsigned char =="
+test_expr "set variable v_unsigned_char=127" "print v_unsigned_char != 0" "${::valnum_re} = $true" "print v_unsigned_char != 127" "${::valnum_re} = $false" "print unsigned char !="
+test_expr "set variable v_unsigned_char=127" "print v_unsigned_char < 0" "${::valnum_re} = $false" "print v_unsigned_char < 127" "${::valnum_re} = $false" "print unsigned char <"
+test_expr "set variable v_unsigned_char=127" "print v_unsigned_char > 0" "${::valnum_re} = $true" "print v_unsigned_char > 127" "${::valnum_re} = $false" "print unsigned char >"
# make char a minus
-test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char == 0" "\\$\[0-9\]* = $false" "print v_unsigned_char == ~0" "\\$\[0-9\]* = $false" "print v_unsigned_char == (unsigned char)~0" "\\$\[0-9\]* = $true" "print unsigned char == (~0)"
-test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char != 0" "\\$\[0-9\]* = $true" "print v_unsigned_char != (unsigned char)~0" "\\$\[0-9\]* = $false" "print v_unsigned_char != ~0" "\\$\[0-9\]* = $true" "print unsigned char != (~0)"
-test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char < 0" "\\$\[0-9\]* = $false" "print v_unsigned_char < 127" "\\$\[0-9\]* = $false" "print unsigned char < (~0)"
-test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char > 0" "\\$\[0-9\]* = $true" "print v_unsigned_char > 127" "\\$\[0-9\]* = $true" "print unsigned char > (~0)"
+test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char == 0" "${::valnum_re} = $false" "print v_unsigned_char == ~0" "${::valnum_re} = $false" "print v_unsigned_char == (unsigned char)~0" "${::valnum_re} = $true" "print unsigned char == (~0)"
+test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char != 0" "${::valnum_re} = $true" "print v_unsigned_char != (unsigned char)~0" "${::valnum_re} = $false" "print v_unsigned_char != ~0" "${::valnum_re} = $true" "print unsigned char != (~0)"
+test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char < 0" "${::valnum_re} = $false" "print v_unsigned_char < 127" "${::valnum_re} = $false" "print unsigned char < (~0)"
+test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char > 0" "${::valnum_re} = $true" "print v_unsigned_char > 127" "${::valnum_re} = $true" "print unsigned char > (~0)"
#
# test expressions with "short" types
#
-test_expr "set variable v_short=0x7FFF" "print v_short == 0" "\\$\[0-9\]* = $false" "print v_short == 0x7FFF" "\\$\[0-9\]* = $true" "print signed short =="
-test_expr "set variable v_short=0x7FFF" "print v_short != 0" "\\$\[0-9\]* = $true" "print v_short != 0x7FFF" "\\$\[0-9\]* = $false" "print signed short !="
-test_expr "set variable v_short=0x7FFF" "print v_short < 0" "\\$\[0-9\]* = $false" "print v_short < 0x7FFF" "\\$\[0-9\]* = $false" "print signed short <"
-test_expr "set variable v_short=0x7FFF" "print v_short > 0" "\\$\[0-9\]* = $true" "print v_short > 0x7FFF" "\\$\[0-9\]* = $false" "print signed short >"
+test_expr "set variable v_short=0x7FFF" "print v_short == 0" "${::valnum_re} = $false" "print v_short == 0x7FFF" "${::valnum_re} = $true" "print signed short =="
+test_expr "set variable v_short=0x7FFF" "print v_short != 0" "${::valnum_re} = $true" "print v_short != 0x7FFF" "${::valnum_re} = $false" "print signed short !="
+test_expr "set variable v_short=0x7FFF" "print v_short < 0" "${::valnum_re} = $false" "print v_short < 0x7FFF" "${::valnum_re} = $false" "print signed short <"
+test_expr "set variable v_short=0x7FFF" "print v_short > 0" "${::valnum_re} = $true" "print v_short > 0x7FFF" "${::valnum_re} = $false" "print signed short >"
# make short a minus
-test_expr "set variable v_short=-1" "print v_short == 0" "\\$\[0-9\]* = $false" "print v_short == -1" "\\$\[0-9\]* = $true" "print signed short == (minus)"
-test_expr "set variable v_short=-1" "print v_short != 0" "\\$\[0-9\]* = $true" "print v_short != -1" "\\$\[0-9\]* = $false" "print signed short != (minus)"
-test_expr "set variable v_short=-1" "print v_short < 0" "\\$\[0-9\]* = $true" "print v_short < 0x7FFF" "\\$\[0-9\]* = $true" "print signed short < (minus)"
-test_expr "set variable v_short=-1" "print v_short > 0" "\\$\[0-9\]* = $false" "print v_short > 0x7FFF" "\\$\[0-9\]* = $false" "print signed short > (minus)"
+test_expr "set variable v_short=-1" "print v_short == 0" "${::valnum_re} = $false" "print v_short == -1" "${::valnum_re} = $true" "print signed short == (minus)"
+test_expr "set variable v_short=-1" "print v_short != 0" "${::valnum_re} = $true" "print v_short != -1" "${::valnum_re} = $false" "print signed short != (minus)"
+test_expr "set variable v_short=-1" "print v_short < 0" "${::valnum_re} = $true" "print v_short < 0x7FFF" "${::valnum_re} = $true" "print signed short < (minus)"
+test_expr "set variable v_short=-1" "print v_short > 0" "${::valnum_re} = $false" "print v_short > 0x7FFF" "${::valnum_re} = $false" "print signed short > (minus)"
#
# test expressions with "signed short" types
#
-test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short == 0" "\\$\[0-9\]* = $false" "print v_signed_short == 0x7FFF" "\\$\[0-9\]* = $true" "print signed signed short =="
-test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short != 0" "\\$\[0-9\]* = $true" "print v_signed_short != 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed short !="
-test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short < 0" "\\$\[0-9\]* = $false" "print v_signed_short < 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed short <"
-test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short > 0" "\\$\[0-9\]* = $true" "print v_signed_short > 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed short >"
+test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short == 0" "${::valnum_re} = $false" "print v_signed_short == 0x7FFF" "${::valnum_re} = $true" "print signed signed short =="
+test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short != 0" "${::valnum_re} = $true" "print v_signed_short != 0x7FFF" "${::valnum_re} = $false" "print signed signed short !="
+test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short < 0" "${::valnum_re} = $false" "print v_signed_short < 0x7FFF" "${::valnum_re} = $false" "print signed signed short <"
+test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short > 0" "${::valnum_re} = $true" "print v_signed_short > 0x7FFF" "${::valnum_re} = $false" "print signed signed short >"
# make short a minus
-test_expr "set variable v_signed_short=-1" "print v_signed_short == 0" "\\$\[0-9\]* = $false" "print v_signed_short == -1" "\\$\[0-9\]* = $true" "print signed signed short == (minus)"
-test_expr "set variable v_signed_short=-1" "print v_signed_short != 0" "\\$\[0-9\]* = $true" "print v_signed_short != -1" "\\$\[0-9\]* = $false" "print signed signed short != (minus)"
-test_expr "set variable v_signed_short=-1" "print v_signed_short < 0" "\\$\[0-9\]* = $true" "print v_signed_short < 0x7FFF" "\\$\[0-9\]* = $true" "print signed signed short < (minus)"
-test_expr "set variable v_signed_short=-1" "print v_signed_short > 0" "\\$\[0-9\]* = $false" "print v_signed_short > 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed short > (minus)"
+test_expr "set variable v_signed_short=-1" "print v_signed_short == 0" "${::valnum_re} = $false" "print v_signed_short == -1" "${::valnum_re} = $true" "print signed signed short == (minus)"
+test_expr "set variable v_signed_short=-1" "print v_signed_short != 0" "${::valnum_re} = $true" "print v_signed_short != -1" "${::valnum_re} = $false" "print signed signed short != (minus)"
+test_expr "set variable v_signed_short=-1" "print v_signed_short < 0" "${::valnum_re} = $true" "print v_signed_short < 0x7FFF" "${::valnum_re} = $true" "print signed signed short < (minus)"
+test_expr "set variable v_signed_short=-1" "print v_signed_short > 0" "${::valnum_re} = $false" "print v_signed_short > 0x7FFF" "${::valnum_re} = $false" "print signed signed short > (minus)"
#
# test expressions with "unsigned short" types
#
-test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short == 0" "\\$\[0-9\]* = $false" "print v_unsigned_short == 0x7FFF" "\\$\[0-9\]* = $true" "print unsigned short =="
-test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short != 0" "\\$\[0-9\]* = $true" "print v_unsigned_short != 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned short !="
-test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short < 0" "\\$\[0-9\]* = $false" "print v_unsigned_short < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned short <"
-test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short > 0" "\\$\[0-9\]* = $true" "print v_unsigned_short > 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned short >"
+test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short == 0" "${::valnum_re} = $false" "print v_unsigned_short == 0x7FFF" "${::valnum_re} = $true" "print unsigned short =="
+test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short != 0" "${::valnum_re} = $true" "print v_unsigned_short != 0x7FFF" "${::valnum_re} = $false" "print unsigned short !="
+test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short < 0" "${::valnum_re} = $false" "print v_unsigned_short < 0x7FFF" "${::valnum_re} = $false" "print unsigned short <"
+test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short > 0" "${::valnum_re} = $true" "print v_unsigned_short > 0x7FFF" "${::valnum_re} = $false" "print unsigned short >"
# make short a minus
-test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short == 0" "\\$\[0-9\]* = $false" "print sizeof (v_unsigned_short) < sizeof (~0) && v_unsigned_short == ~0" "\\$\[0-9\]* = $false" "print v_unsigned_short == (unsigned short)~0" "\\$\[0-9\]* = $true" "print unsigned short == (~0)"
-test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short != 0" "\\$\[0-9\]* = $true" "print v_unsigned_short != (unsigned short)~0" "\\$\[0-9\]* = $false" "print unsigned short != (~0)"
-test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short < 0" "\\$\[0-9\]* = $false" "print v_unsigned_short < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned short < (~0)"
-test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short > 0" "\\$\[0-9\]* = $true" "print v_unsigned_short > 0x7FFF" "\\$\[0-9\]* = $true" "print unsigned short > (~0)"
+test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short == 0" "${::valnum_re} = $false" "print sizeof (v_unsigned_short) < sizeof (~0) && v_unsigned_short == ~0" "${::valnum_re} = $false" "print v_unsigned_short == (unsigned short)~0" "${::valnum_re} = $true" "print unsigned short == (~0)"
+test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short != 0" "${::valnum_re} = $true" "print v_unsigned_short != (unsigned short)~0" "${::valnum_re} = $false" "print unsigned short != (~0)"
+test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short < 0" "${::valnum_re} = $false" "print v_unsigned_short < 0x7FFF" "${::valnum_re} = $false" "print unsigned short < (~0)"
+test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short > 0" "${::valnum_re} = $true" "print v_unsigned_short > 0x7FFF" "${::valnum_re} = $true" "print unsigned short > (~0)"
#
# test expressions with "int" types
#
-test_expr "set variable v_int=0x7FFF" "print v_int == 0" "\\$\[0-9\]* = $false" "print v_int == 0x7FFF" "\\$\[0-9\]* = $true" "print signed int =="
-test_expr "set variable v_int=0x7FFF" "print v_int != 0" "\\$\[0-9\]* = $true" "print v_int != 0x7FFF" "\\$\[0-9\]* = $false" "print signed int !="
-test_expr "set variable v_int=0x7FFF" "print v_int < 0" "\\$\[0-9\]* = $false" "print v_int < 0x7FFF" "\\$\[0-9\]* = $false" "print signed int <"
-test_expr "set variable v_int=0x7FFF" "print v_int > 0" "\\$\[0-9\]* = $true" "print v_int > 0x7FFF" "\\$\[0-9\]* = $false" "print signed int >"
+test_expr "set variable v_int=0x7FFF" "print v_int == 0" "${::valnum_re} = $false" "print v_int == 0x7FFF" "${::valnum_re} = $true" "print signed int =="
+test_expr "set variable v_int=0x7FFF" "print v_int != 0" "${::valnum_re} = $true" "print v_int != 0x7FFF" "${::valnum_re} = $false" "print signed int !="
+test_expr "set variable v_int=0x7FFF" "print v_int < 0" "${::valnum_re} = $false" "print v_int < 0x7FFF" "${::valnum_re} = $false" "print signed int <"
+test_expr "set variable v_int=0x7FFF" "print v_int > 0" "${::valnum_re} = $true" "print v_int > 0x7FFF" "${::valnum_re} = $false" "print signed int >"
# make int a minus
-test_expr "set variable v_int=-1" "print v_int == 0" "\\$\[0-9\]* = $false" "print v_int == -1" "\\$\[0-9\]* = $true" "print signed int == (minus)"
-test_expr "set variable v_int=-1" "print v_int != 0" "\\$\[0-9\]* = $true" "print v_int != -1" "\\$\[0-9\]* = $false" "print signed int != (minus)"
-test_expr "set variable v_int=-1" "print v_int < 0" "\\$\[0-9\]* = $true" "print v_int < 0x7FFF" "\\$\[0-9\]* = $true" "print signed int < (minus)"
-test_expr "set variable v_int=-1" "print v_int > 0" "\\$\[0-9\]* = $false" "print v_int > 0x7FFF" "\\$\[0-9\]* = $false" "print signed int > (minus)"
+test_expr "set variable v_int=-1" "print v_int == 0" "${::valnum_re} = $false" "print v_int == -1" "${::valnum_re} = $true" "print signed int == (minus)"
+test_expr "set variable v_int=-1" "print v_int != 0" "${::valnum_re} = $true" "print v_int != -1" "${::valnum_re} = $false" "print signed int != (minus)"
+test_expr "set variable v_int=-1" "print v_int < 0" "${::valnum_re} = $true" "print v_int < 0x7FFF" "${::valnum_re} = $true" "print signed int < (minus)"
+test_expr "set variable v_int=-1" "print v_int > 0" "${::valnum_re} = $false" "print v_int > 0x7FFF" "${::valnum_re} = $false" "print signed int > (minus)"
#
# test expressions with "signed int" types
#
-test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int == 0" "\\$\[0-9\]* = $false" "print v_signed_int == 0x7FFF" "\\$\[0-9\]* = $true" "print signed signed int =="
-test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int != 0" "\\$\[0-9\]* = $true" "print v_signed_int != 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed int !="
-test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int < 0" "\\$\[0-9\]* = $false" "print v_signed_int < 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed int <"
-test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int > 0" "\\$\[0-9\]* = $true" "print v_signed_int > 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed int >"
+test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int == 0" "${::valnum_re} = $false" "print v_signed_int == 0x7FFF" "${::valnum_re} = $true" "print signed signed int =="
+test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int != 0" "${::valnum_re} = $true" "print v_signed_int != 0x7FFF" "${::valnum_re} = $false" "print signed signed int !="
+test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int < 0" "${::valnum_re} = $false" "print v_signed_int < 0x7FFF" "${::valnum_re} = $false" "print signed signed int <"
+test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int > 0" "${::valnum_re} = $true" "print v_signed_int > 0x7FFF" "${::valnum_re} = $false" "print signed signed int >"
# make int a minus
-test_expr "set variable v_signed_int=-1" "print v_signed_int == 0" "\\$\[0-9\]* = $false" "print v_signed_int == -1" "\\$\[0-9\]* = $true" "print signed signed int == (minus)"
-test_expr "set variable v_signed_int=-1" "print v_signed_int != 0" "\\$\[0-9\]* = $true" "print v_signed_int != -1" "\\$\[0-9\]* = $false" "print signed signed int != (minus)"
-test_expr "set variable v_signed_int=-1" "print v_signed_int < 0" "\\$\[0-9\]* = $true" "print v_signed_int < 0x7FFF" "\\$\[0-9\]* = $true" "print signed signed int < (minus)"
-test_expr "set variable v_signed_int=-1" "print v_signed_int > 0" "\\$\[0-9\]* = $false" "print v_signed_int > 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed int > (minus)"
+test_expr "set variable v_signed_int=-1" "print v_signed_int == 0" "${::valnum_re} = $false" "print v_signed_int == -1" "${::valnum_re} = $true" "print signed signed int == (minus)"
+test_expr "set variable v_signed_int=-1" "print v_signed_int != 0" "${::valnum_re} = $true" "print v_signed_int != -1" "${::valnum_re} = $false" "print signed signed int != (minus)"
+test_expr "set variable v_signed_int=-1" "print v_signed_int < 0" "${::valnum_re} = $true" "print v_signed_int < 0x7FFF" "${::valnum_re} = $true" "print signed signed int < (minus)"
+test_expr "set variable v_signed_int=-1" "print v_signed_int > 0" "${::valnum_re} = $false" "print v_signed_int > 0x7FFF" "${::valnum_re} = $false" "print signed signed int > (minus)"
#
# test expressions with "unsigned int" types
#
-test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int == 0" "\\$\[0-9\]* = $false" "print v_unsigned_int == 0x7FFF" "\\$\[0-9\]* = $true" "print unsigned int =="
-test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int != 0" "\\$\[0-9\]* = $true" "print v_unsigned_int != 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned int !="
-test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int < 0" "\\$\[0-9\]* = $false" "print v_unsigned_int < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned int <"
-test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int > 0" "\\$\[0-9\]* = $true" "print v_unsigned_int > 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned int >"
+test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int == 0" "${::valnum_re} = $false" "print v_unsigned_int == 0x7FFF" "${::valnum_re} = $true" "print unsigned int =="
+test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int != 0" "${::valnum_re} = $true" "print v_unsigned_int != 0x7FFF" "${::valnum_re} = $false" "print unsigned int !="
+test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int < 0" "${::valnum_re} = $false" "print v_unsigned_int < 0x7FFF" "${::valnum_re} = $false" "print unsigned int <"
+test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int > 0" "${::valnum_re} = $true" "print v_unsigned_int > 0x7FFF" "${::valnum_re} = $false" "print unsigned int >"
# make int a minus
-test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int == 0" "\\$\[0-9\]* = $false" "print v_unsigned_int == ~0" "\\$\[0-9\]* = $true" "print v_unsigned_int == (unsigned int)~0" "\\$\[0-9\]* = $true" "print unsigned int == (~0)"
-test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int != 0" "\\$\[0-9\]* = $true" "print v_unsigned_int != (unsigned int)~0" "\\$\[0-9\]* = $false" "print unsigned int != (~0)"
-test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int < 0" "\\$\[0-9\]* = $false" "print v_unsigned_int < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned int < (~0)"
-test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int > 0" "\\$\[0-9\]* = $true" "print v_unsigned_int > 0x7FFF" "\\$\[0-9\]* = $true" "print unsigned int > (~0)"
+test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int == 0" "${::valnum_re} = $false" "print v_unsigned_int == ~0" "${::valnum_re} = $true" "print v_unsigned_int == (unsigned int)~0" "${::valnum_re} = $true" "print unsigned int == (~0)"
+test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int != 0" "${::valnum_re} = $true" "print v_unsigned_int != (unsigned int)~0" "${::valnum_re} = $false" "print unsigned int != (~0)"
+test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int < 0" "${::valnum_re} = $false" "print v_unsigned_int < 0x7FFF" "${::valnum_re} = $false" "print unsigned int < (~0)"
+test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int > 0" "${::valnum_re} = $true" "print v_unsigned_int > 0x7FFF" "${::valnum_re} = $true" "print unsigned int > (~0)"
#
# test expressions with "long" types
#
-test_expr "set variable v_long=0x7FFF" "print v_long == 0" "\\$\[0-9\]* = $false" "print v_long == 0x7FFF" "\\$\[0-9\]* = $true" "print signed long =="
-test_expr "set variable v_long=0x7FFF" "print v_long != 0" "\\$\[0-9\]* = $true" "print v_long != 0x7FFF" "\\$\[0-9\]* = $false" "print signed long !="
-test_expr "set variable v_long=0x7FFF" "print v_long < 0" "\\$\[0-9\]* = $false" "print v_long < 0x7FFF" "\\$\[0-9\]* = $false" "print signed long <"
-test_expr "set variable v_long=0x7FFF" "print v_long > 0" "\\$\[0-9\]* = $true" "print v_long > 0x7FFF" "\\$\[0-9\]* = $false" "print signed long >"
+test_expr "set variable v_long=0x7FFF" "print v_long == 0" "${::valnum_re} = $false" "print v_long == 0x7FFF" "${::valnum_re} = $true" "print signed long =="
+test_expr "set variable v_long=0x7FFF" "print v_long != 0" "${::valnum_re} = $true" "print v_long != 0x7FFF" "${::valnum_re} = $false" "print signed long !="
+test_expr "set variable v_long=0x7FFF" "print v_long < 0" "${::valnum_re} = $false" "print v_long < 0x7FFF" "${::valnum_re} = $false" "print signed long <"
+test_expr "set variable v_long=0x7FFF" "print v_long > 0" "${::valnum_re} = $true" "print v_long > 0x7FFF" "${::valnum_re} = $false" "print signed long >"
# make long a minus
-test_expr "set variable v_long=-1" "print v_long == 0" "\\$\[0-9\]* = $false" "print v_long == -1" "\\$\[0-9\]* = $true" "print signed long == (minus)"
-test_expr "set variable v_long=-1" "print v_long != 0" "\\$\[0-9\]* = $true" "print v_long != -1" "\\$\[0-9\]* = $false" "print signed long != (minus)"
-test_expr "set variable v_long=-1" "print v_long < 0" "\\$\[0-9\]* = $true" "print v_long < 0x7FFF" "\\$\[0-9\]* = $true" "print signed long < (minus)"
-test_expr "set variable v_long=-1" "print v_long > 0" "\\$\[0-9\]* = $false" "print v_long > 0x7FFF" "\\$\[0-9\]* = $false" "print signed long > (minus)"
+test_expr "set variable v_long=-1" "print v_long == 0" "${::valnum_re} = $false" "print v_long == -1" "${::valnum_re} = $true" "print signed long == (minus)"
+test_expr "set variable v_long=-1" "print v_long != 0" "${::valnum_re} = $true" "print v_long != -1" "${::valnum_re} = $false" "print signed long != (minus)"
+test_expr "set variable v_long=-1" "print v_long < 0" "${::valnum_re} = $true" "print v_long < 0x7FFF" "${::valnum_re} = $true" "print signed long < (minus)"
+test_expr "set variable v_long=-1" "print v_long > 0" "${::valnum_re} = $false" "print v_long > 0x7FFF" "${::valnum_re} = $false" "print signed long > (minus)"
#
# test expressions with "signed long" types
#
-test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long == 0" "\\$\[0-9\]* = $false" "print v_signed_long == 0x7FFF" "\\$\[0-9\]* = $true" "print signed signed long =="
-test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long != 0" "\\$\[0-9\]* = $true" "print v_signed_long != 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed long !="
-test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long < 0" "\\$\[0-9\]* = $false" "print v_signed_long < 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed long <"
-test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long > 0" "\\$\[0-9\]* = $true" "print v_signed_long > 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed long >"
+test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long == 0" "${::valnum_re} = $false" "print v_signed_long == 0x7FFF" "${::valnum_re} = $true" "print signed signed long =="
+test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long != 0" "${::valnum_re} = $true" "print v_signed_long != 0x7FFF" "${::valnum_re} = $false" "print signed signed long !="
+test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long < 0" "${::valnum_re} = $false" "print v_signed_long < 0x7FFF" "${::valnum_re} = $false" "print signed signed long <"
+test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long > 0" "${::valnum_re} = $true" "print v_signed_long > 0x7FFF" "${::valnum_re} = $false" "print signed signed long >"
# make long a minus
-test_expr "set variable v_signed_long=-1" "print v_signed_long == 0" "\\$\[0-9\]* = $false" "print v_signed_long == -1" "\\$\[0-9\]* = $true" "print signed signed long == (minus)"
-test_expr "set variable v_signed_long=-1" "print v_signed_long != 0" "\\$\[0-9\]* = $true" "print v_signed_long != -1" "\\$\[0-9\]* = $false" "print signed signed long != (minus)"
-test_expr "set variable v_signed_long=-1" "print v_signed_long < 0" "\\$\[0-9\]* = $true" "print v_signed_long < 0x7FFF" "\\$\[0-9\]* = $true" "print signed signed long < (minus)"
-test_expr "set variable v_signed_long=-1" "print v_signed_long > 0" "\\$\[0-9\]* = $false" "print v_signed_long > 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed long > (minus)"
+test_expr "set variable v_signed_long=-1" "print v_signed_long == 0" "${::valnum_re} = $false" "print v_signed_long == -1" "${::valnum_re} = $true" "print signed signed long == (minus)"
+test_expr "set variable v_signed_long=-1" "print v_signed_long != 0" "${::valnum_re} = $true" "print v_signed_long != -1" "${::valnum_re} = $false" "print signed signed long != (minus)"
+test_expr "set variable v_signed_long=-1" "print v_signed_long < 0" "${::valnum_re} = $true" "print v_signed_long < 0x7FFF" "${::valnum_re} = $true" "print signed signed long < (minus)"
+test_expr "set variable v_signed_long=-1" "print v_signed_long > 0" "${::valnum_re} = $false" "print v_signed_long > 0x7FFF" "${::valnum_re} = $false" "print signed signed long > (minus)"
#
# test expressions with "unsigned long" types
#
-test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long == 0" "\\$\[0-9\]* = $false" "print v_unsigned_long == 0x7FFF" "\\$\[0-9\]* = $true" "print unsigned long =="
-test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long != 0" "\\$\[0-9\]* = $true" "print v_unsigned_long != 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned long !="
-test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long < 0" "\\$\[0-9\]* = $false" "print v_unsigned_long < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned long <"
-test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long > 0" "\\$\[0-9\]* = $true" "print v_unsigned_long > 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned long >"
+test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long == 0" "${::valnum_re} = $false" "print v_unsigned_long == 0x7FFF" "${::valnum_re} = $true" "print unsigned long =="
+test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long != 0" "${::valnum_re} = $true" "print v_unsigned_long != 0x7FFF" "${::valnum_re} = $false" "print unsigned long !="
+test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long < 0" "${::valnum_re} = $false" "print v_unsigned_long < 0x7FFF" "${::valnum_re} = $false" "print unsigned long <"
+test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long > 0" "${::valnum_re} = $true" "print v_unsigned_long > 0x7FFF" "${::valnum_re} = $false" "print unsigned long >"
# make long a minus
-test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long == 0" "\\$\[0-9\]* = $false" "print v_unsigned_long == ~0" "\\$\[0-9\]* = $true" "print v_unsigned_long == (unsigned long)~0" "\\$\[0-9\]* = $true" "print unsigned long == (~0)"
-test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long != 0" "\\$\[0-9\]* = $true" "print v_unsigned_long != (unsigned long)~0" "\\$\[0-9\]* = $false" "print unsigned long != (~0)"
-test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long < 0" "\\$\[0-9\]* = $false" "print v_unsigned_long < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned long < (~0)"
-test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long > 0" "\\$\[0-9\]* = $true" "print v_unsigned_long > 0x7FFF" "\\$\[0-9\]* = $true" "print unsigned long > (~0)"
+test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long == 0" "${::valnum_re} = $false" "print v_unsigned_long == ~0" "${::valnum_re} = $true" "print v_unsigned_long == (unsigned long)~0" "${::valnum_re} = $true" "print unsigned long == (~0)"
+test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long != 0" "${::valnum_re} = $true" "print v_unsigned_long != (unsigned long)~0" "${::valnum_re} = $false" "print unsigned long != (~0)"
+test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long < 0" "${::valnum_re} = $false" "print v_unsigned_long < 0x7FFF" "${::valnum_re} = $false" "print unsigned long < (~0)"
+test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long > 0" "${::valnum_re} = $true" "print v_unsigned_long > 0x7FFF" "${::valnum_re} = $true" "print unsigned long > (~0)"
#
# Test expressions with casts to a pointer.
# NB: Some architectures convert a ``NULL'' pointer into
@@ -194,14 +194,14 @@ test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long > 0" "\\$\[0-
# Prevent symbol on address 0x0 being printed.
gdb_test_no_output "set print symbol off"
-test_expr "set variable v_signed_char = 0" "print (void*)v_signed_char" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_signed_char"
-test_expr "set variable v_signed_short = 0" "print (void*)v_signed_short" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_signed_short"
-test_expr "set variable v_signed_int = 0" "print (void*)v_signed_int" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_signed_int"
-test_expr "set variable v_signed_long = 0" "print (void*)v_signed_long" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_signed_long"
-test_expr "set variable v_unsigned_char = 0" "print (void*)v_unsigned_char" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_unsigned_char"
-test_expr "set variable v_unsigned_short = 0" "print (void*)v_unsigned_short" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_unsigned_short"
-test_expr "set variable v_unsigned_int = 0" "print (void*)v_unsigned_int" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_unsigned_int"
-test_expr "set variable v_unsigned_long = 0" "print (void*)v_unsigned_long" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_unsigned_long"
+test_expr "set variable v_signed_char = 0" "print (void*)v_signed_char" "${::valnum_re} = .void \\*. $hex" "print (void*)v_signed_char"
+test_expr "set variable v_signed_short = 0" "print (void*)v_signed_short" "${::valnum_re} = .void \\*. $hex" "print (void*)v_signed_short"
+test_expr "set variable v_signed_int = 0" "print (void*)v_signed_int" "${::valnum_re} = .void \\*. $hex" "print (void*)v_signed_int"
+test_expr "set variable v_signed_long = 0" "print (void*)v_signed_long" "${::valnum_re} = .void \\*. $hex" "print (void*)v_signed_long"
+test_expr "set variable v_unsigned_char = 0" "print (void*)v_unsigned_char" "${::valnum_re} = .void \\*. $hex" "print (void*)v_unsigned_char"
+test_expr "set variable v_unsigned_short = 0" "print (void*)v_unsigned_short" "${::valnum_re} = .void \\*. $hex" "print (void*)v_unsigned_short"
+test_expr "set variable v_unsigned_int = 0" "print (void*)v_unsigned_int" "${::valnum_re} = .void \\*. $hex" "print (void*)v_unsigned_int"
+test_expr "set variable v_unsigned_long = 0" "print (void*)v_unsigned_long" "${::valnum_re} = .void \\*. $hex" "print (void*)v_unsigned_long"
#
# Test expressions with pointers out of range
#
@@ -211,11 +211,11 @@ test_expr "set variable v_unsigned_long = 0" "print (void*)v_unsigned_long" "\\$
#
gdb_test_multiple "print sizeof (long long) > sizeof (long)" \
"sizeof long long > sizeof long" {
- -re "\\$\[0-9\]* = $true.*$gdb_prompt" {
+ -re "${::valnum_re} = $true.*$gdb_prompt" {
set ok 1
pass "sizeof (long long) > sizeof (long) (true)"
}
- -re "\\$\[0-9\]* = $false.*$gdb_prompt" {
+ -re "${::valnum_re} = $false.*$gdb_prompt" {
set ok 0
pass "sizeof (long long) > sizeof (long) (false)"
}
@@ -228,24 +228,24 @@ gdb_test "print (void*) (~((long long)(unsigned long) -1) - 1)" \
"warning: value truncated.*" "truncate (void*) 0xffffffff00000000 - 1"
# String concatentation.
-test_expr "print \"x\" \"y\"" "\\$\[0-9\]* = \"xy\""
-test_expr "print \"x\" \"y\" \"z\"" "\\$\[0-9\]* = \"xyz\""
+test_expr "print \"x\" \"y\"" "${::valnum_re} = \"xy\""
+test_expr "print \"x\" \"y\" \"z\"" "${::valnum_re} = \"xyz\""
# Enum formatting tests.
-test_expr "print red" "\\$\[0-9\]* = red"
+test_expr "print red" "${::valnum_re} = red"
with_test_prefix "output-radix 8" {
gdb_test "set output-radix 8" ".*"
- test_expr "print red" "\\$\[0-9\]* = red"
- test_expr "print/d red" "\\$\[0-9\]* = 0"
+ test_expr "print red" "${::valnum_re} = red"
+ test_expr "print/d red" "${::valnum_re} = 0"
gdb_test "set output-radix 10" ".*"
}
# Pre-/post in-/decrement tests.
gdb_test "set variable v_int = 1" ""
-gdb_test "print v_int++" "\\$\[0-9\]* = 1"
-gdb_test "print ++v_int" "\\$\[0-9\]* = 3"
-gdb_test "print v_int--" "\\$\[0-9\]* = 3"
-gdb_test "print --v_int" "\\$\[0-9\]* = 1"
+gdb_test "print v_int++" "${::valnum_re} = 1"
+gdb_test "print ++v_int" "${::valnum_re} = 3"
+gdb_test "print v_int--" "${::valnum_re} = 3"
+gdb_test "print --v_int" "${::valnum_re} = 1"
gdb_test "print v_int++ = 5" "Left operand of assignment is not an lvalue."
gdb_test "print v_int-- = 5" "Left operand of assignment is not an lvalue."
diff --git a/gdb/testsuite/gdb.base/gdb1090.exp b/gdb/testsuite/gdb.base/gdb1090.exp
index ffa6d13bbcc..5e0e6e1047b 100644
--- a/gdb/testsuite/gdb.base/gdb1090.exp
+++ b/gdb/testsuite/gdb.base/gdb1090.exp
@@ -36,10 +36,10 @@ gdb_breakpoint [gdb_get_line_number "break-here"]
gdb_continue_to_breakpoint "break-here" ".* break-here .*"
gdb_test_multiple "print s24" "print s24" {
- -re "\\\$\[0-9\]* = \\{field_0 = 1170, field_1 = 64701\\}\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = \\{field_0 = 1170, field_1 = 64701\\}\r\n$gdb_prompt $" {
pass "print s24"
}
- -re "\\\$\[0-9\]* = \\{field_0 = 1170, field_1 = .*\\}\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = \\{field_0 = 1170, field_1 = .*\\}\r\n$gdb_prompt $" {
# happens with gcc 2.95.3, which actually puts s24 in registers.
# gdb cannot find the second register and prints garbage.
kfail "gdb/1090" "print s24"
diff --git a/gdb/testsuite/gdb.base/offsets.exp b/gdb/testsuite/gdb.base/offsets.exp
index 13283ccca92..2286f0c2276 100644
--- a/gdb/testsuite/gdb.base/offsets.exp
+++ b/gdb/testsuite/gdb.base/offsets.exp
@@ -24,7 +24,7 @@ if { [prepare_for_testing "failed to prepare for testing large offsets" \
set test "print &big_struct test"
gdb_test_multiple "print &big_struct" "$test" {
- -re "\\$\[0-9\]* = .* (0x\[0-9a-fA-F\]*) .*\[\r\n\]*$gdb_prompt $" {
+ -re "${::valnum_re} = .* (0x\[0-9a-fA-F\]*) .*\[\r\n\]*$gdb_prompt $" {
set addr1 $expect_out(1,string)
pass "$test ($addr1)"
}
@@ -32,7 +32,7 @@ gdb_test_multiple "print &big_struct" "$test" {
set test "print &big_struct.second test"
gdb_test_multiple "print &big_struct.second" "$test" {
- -re "\\$\[0-9\]* = .* (0x\[0-9a-fA-F\]*) .*\[\r\n\]*$gdb_prompt $" {
+ -re "${::valnum_re} = .* (0x\[0-9a-fA-F\]*) .*\[\r\n\]*$gdb_prompt $" {
set addr2 $expect_out(1,string)
if {[expr {$addr2 - $addr1}] == [expr {0x10000000 + 16}]} {
diff --git a/gdb/testsuite/gdb.base/readline.exp b/gdb/testsuite/gdb.base/readline.exp
index 5f75b70e7e4..f8f9adecf8f 100644
--- a/gdb/testsuite/gdb.base/readline.exp
+++ b/gdb/testsuite/gdb.base/readline.exp
@@ -174,10 +174,10 @@ save_vars { env(TERM) } {
# Verify that arrow keys work in secondary prompts. The control
# sequence is a hard-coded VT100 up arrow.
- gdb_test "print 42" "\\\$\[0-9\]* = 42"
+ gdb_test "print 42" "${::valnum_re} = 42"
set msg "arrow keys with secondary prompt"
gdb_test_multiple "if 1 > 0\n\033\[A\033\[A\nend" $msg {
- -re ".*\\\$\[0-9\]* = 42\r\n$gdb_prompt $" {
+ -re ".*${::valnum_re} = 42\r\n$gdb_prompt $" {
pass $msg
}
-re ".*Undefined command:.*$gdb_prompt $" {
@@ -188,9 +188,9 @@ save_vars { env(TERM) } {
# Use the up arrow to select a previous command. Check that
# no unexpected output is added between the previously
# selected command, and the output of that command.
- gdb_test "print 123" "\\\$\[0-9\]* = 123"
+ gdb_test "print 123" "${::valnum_re} = 123"
gdb_test_multiple "\033\[A" "use up arrow" {
- -re -wrap "print 123\r\n\\\$\[0-9\]* = 123" {
+ -re -wrap "print 123\r\n${::valnum_re} = 123" {
pass $gdb_test_name
}
}
diff --git a/gdb/testsuite/gdb.cp/anon-union.exp b/gdb/testsuite/gdb.cp/anon-union.exp
index ae66c2374b8..5b26f7a848d 100644
--- a/gdb/testsuite/gdb.cp/anon-union.exp
+++ b/gdb/testsuite/gdb.cp/anon-union.exp
@@ -62,7 +62,7 @@ gdb_test "next" "40\[ \t\]*foo.paper = 33;" "next 1"
# Print out the big anon union.
gdb_test "print foo" \
- "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 0, x = \{rock = 0, rock2 = 0\}, \{qux = 0, mux = 0\}, boulder = 0\}, \{paper = 0, cloth = 0\}, num2 = \{two = 0, three = 0\}\}" \
+ "${::valnum_re} = \{num1 = \{zero = 0, one = 0\}, \{pebble = 0, x = \{rock = 0, rock2 = 0\}, \{qux = 0, mux = 0\}, boulder = 0\}, \{paper = 0, cloth = 0\}, num2 = \{two = 0, three = 0\}\}" \
"print foo 1"
# Step over assignment to member
@@ -71,7 +71,7 @@ gdb_test "next" "41\[ \t\]*foo.pebble = 44;" "next 2"
# Now print out anon union again
gdb_test "print foo" \
- "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 0, x = \{rock = 0, rock2 = 0\}, \{qux = 0, mux = 0\}, boulder = 0\}, \{paper = 33, cloth = 33\}, num2 = \{two = 0, three = 0\}\}" \
+ "${::valnum_re} = \{num1 = \{zero = 0, one = 0\}, \{pebble = 0, x = \{rock = 0, rock2 = 0\}, \{qux = 0, mux = 0\}, boulder = 0\}, \{paper = 33, cloth = 33\}, num2 = \{two = 0, three = 0\}\}" \
"print foo 2"
# Modify the member just set
@@ -79,7 +79,7 @@ gdb_test_no_output "set var foo.cloth = 35" "set var foo.cloth"
# Now print out anon union again to see if the right member was set
gdb_test "print foo" \
- "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 0, x = \{rock = 0, rock2 = 0\}, \{qux = 0, mux = 0\}, boulder = 0\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \
+ "${::valnum_re} = \{num1 = \{zero = 0, one = 0\}, \{pebble = 0, x = \{rock = 0, rock2 = 0\}, \{qux = 0, mux = 0\}, boulder = 0\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \
"print foo 3"
# Step over next assignment to member
@@ -88,7 +88,7 @@ gdb_test "next" "42\[ \t\]*foo.mux = 55;" "next 3"
# Now print out anon union again
gdb_test "print foo" \
- "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 44, x = \{rock = 44, rock2 = 0\}, \{qux = 44, mux = 44\}, boulder = 44\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \
+ "${::valnum_re} = \{num1 = \{zero = 0, one = 0\}, \{pebble = 44, x = \{rock = 44, rock2 = 0\}, \{qux = 44, mux = 44\}, boulder = 44\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \
"print foo 4"
# Modify the member just set
@@ -96,7 +96,7 @@ gdb_test_no_output "set var foo.pebble = 45" "set var foo.pebble"
# Now print out anon union again to see if the right member was set
gdb_test "print foo" \
- "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 45, x = \{rock = 45, rock2 = 0\}, \{qux = 45, mux = 45\}, boulder = 45\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \
+ "${::valnum_re} = \{num1 = \{zero = 0, one = 0\}, \{pebble = 45, x = \{rock = 45, rock2 = 0\}, \{qux = 45, mux = 45\}, boulder = 45\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \
"print foo 5"
# Modify another member at a different level
@@ -104,7 +104,7 @@ gdb_test_no_output "set var foo.qux = 46" "set var foo.qux"
# Now print out anon union again to see if the right member was set
gdb_test "print foo" \
- "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 46, x = \{rock = 46, rock2 = 0\}, \{qux = 46, mux = 46\}, boulder = 46\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \
+ "${::valnum_re} = \{num1 = \{zero = 0, one = 0\}, \{pebble = 46, x = \{rock = 46, rock2 = 0\}, \{qux = 46, mux = 46\}, boulder = 46\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \
"print foo 6"
# Modify the member at another level, but not the first one in the union
@@ -112,7 +112,7 @@ gdb_test_no_output "set var foo.mux = 47" "set var foo.mux"
# Now print out anon union again to see if things worked
gdb_test "print foo" \
- "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 47, x = \{rock = 47, rock2 = 0\}, \{qux = 47, mux = 47\}, boulder = 47\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \
+ "${::valnum_re} = \{num1 = \{zero = 0, one = 0\}, \{pebble = 47, x = \{rock = 47, rock2 = 0\}, \{qux = 47, mux = 47\}, boulder = 47\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \
"print foo 7"
# Modify a member of a struct in an anon union
@@ -120,7 +120,7 @@ gdb_test_no_output "set var foo.x.rock = 48" "set var foo.x.rock"
# Now print out anon union again to see if things worked
gdb_test "print foo" \
- "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 48, x = \{rock = 48, rock2 = 0\}, \{qux = 48, mux = 48\}, boulder = 48\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \
+ "${::valnum_re} = \{num1 = \{zero = 0, one = 0\}, \{pebble = 48, x = \{rock = 48, rock2 = 0\}, \{qux = 48, mux = 48\}, boulder = 48\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \
"print foo 8"
# Modify a member of a struct in an anon union, but something
@@ -129,7 +129,7 @@ gdb_test_no_output "set var foo.x.rock2 = 49" "set var foo.x.rock2"
# Now print out anon union again to see if things worked
gdb_test "print foo" \
- "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 48, x = \{rock = 48, rock2 = 49\}, \{qux = 48, mux = 48\}, boulder = 48\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \
+ "${::valnum_re} = \{num1 = \{zero = 0, one = 0\}, \{pebble = 48, x = \{rock = 48, rock2 = 49\}, \{qux = 48, mux = 48\}, boulder = 48\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \
"print foo 9"
# Step over next four assignments
@@ -137,24 +137,24 @@ gdb_test "next 4" "53\[ \t\]*w = 45;"
# Tests for anon unions that are not members of a class or struct
-gdb_test "print w" "\\$\[0-9\]* = 0" "print w 1"
+gdb_test "print w" "${::valnum_re} = 0" "print w 1"
-gdb_test "print z" "\\$\[0-9\]* = 0" "print z 1"
+gdb_test "print z" "${::valnum_re} = 0" "print z 1"
# Step over next assignment to w
gdb_test "next" "55\[ \t\]*int j = 0;" "next 5"
# See if the change in value is noticed
-gdb_test "print w" "\\$\[0-9\]* = 45" "print w 2"
+gdb_test "print w" "${::valnum_re} = 45" "print w 2"
# See if z shows the same value
-gdb_test "print z" "\\$\[0-9\]* = 45" "print z 2"
+gdb_test "print z" "${::valnum_re} = 45" "print z 2"
# Set the anon union member
gdb_test_no_output "set var z = 27" "set var z"
# See if the change in value is noticed
-gdb_test "print w" "\\$\[0-9\]* = 27" "print w 3"
+gdb_test "print w" "${::valnum_re} = 27" "print w 3"
# See if z shows the same value
-gdb_test "print z" "\\$\[0-9\]* = 27" "print z 3"
+gdb_test "print z" "${::valnum_re} = 27" "print z 3"
diff --git a/gdb/testsuite/gdb.cp/m-data.exp b/gdb/testsuite/gdb.cp/m-data.exp
index 528df376e26..7b67d78d55b 100644
--- a/gdb/testsuite/gdb.cp/m-data.exp
+++ b/gdb/testsuite/gdb.cp/m-data.exp
@@ -42,47 +42,47 @@ gdb_continue_to_breakpoint "end of first constructors"
# One.
# simple object, const bool
-gdb_test "print test1.test" "\\$\[0-9\]* = true" "simple object, const bool"
+gdb_test "print test1.test" "${::valnum_re} = true" "simple object, const bool"
# simple object, const int
-gdb_test "print test1.key1" "\\$\[0-9\]* = 5" "simple object, const int"
+gdb_test "print test1.key1" "${::valnum_re} = 5" "simple object, const int"
# simple object, long
-gdb_test "print test1.key2" "\\$\[0-9\]* = 4589" "simple object, long"
+gdb_test "print test1.key2" "${::valnum_re} = 4589" "simple object, long"
# simple object, enum
-gdb_test "print test1.value" "\\$\[0-9\]* = egyptian" "simple object, enum"
+gdb_test "print test1.value" "${::valnum_re} = egyptian" "simple object, enum"
# Two.
# derived template object, base const bool
-gdb_test "print test2.test" "\\$\[0-9\]* = true" "derived template object, base const bool"
+gdb_test "print test2.test" "${::valnum_re} = true" "derived template object, base const bool"
# derived template object, base const int
-gdb_test "print test2.key1" "\\$\[0-9\]* = 5" "derived template object, base const int"
+gdb_test "print test2.key1" "${::valnum_re} = 5" "derived template object, base const int"
# derived template object, base long
-gdb_test "print test2.key2" "\\$\[0-9\]* = 7" "derived template object, base long"
+gdb_test "print test2.key2" "${::valnum_re} = 7" "derived template object, base long"
# derived template object, base enum
-gdb_test "print test2.value" "\\$\[0-9\]* = oriental" "derived template object, base enum"
+gdb_test "print test2.value" "${::valnum_re} = oriental" "derived template object, base enum"
# derived template object, enum
-gdb_test "print test2.value_derived" "\\$\[0-9\]* = roman" "derived template object, derived enum"
+gdb_test "print test2.value_derived" "${::valnum_re} = roman" "derived template object, derived enum"
# Three.
# template object, derived template data member's base const bool
-gdb_test "print test3.data.test" "\\$\[0-9\]* = true" "template object, const bool"
+gdb_test "print test3.data.test" "${::valnum_re} = true" "template object, const bool"
# template object, derived template data member's base const int
-gdb_test "print test3.data.key1" "\\$\[0-9\]* = 5" "template object, const int"
+gdb_test "print test3.data.key1" "${::valnum_re} = 5" "template object, const int"
# template object, derived template data member's base long
-gdb_test "print test3.data.key2" "\\$\[0-9\]* = 7" "template object, long"
+gdb_test "print test3.data.key2" "${::valnum_re} = 7" "template object, long"
# template object, derived template data member's base enum
-gdb_test "print test3.data.value" "\\$\[0-9\]* = oriental" "template object, base enum"
+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"
diff --git a/gdb/testsuite/gdb.cp/m-static.exp b/gdb/testsuite/gdb.cp/m-static.exp
index 437a69053a9..05516d918ac 100644
--- a/gdb/testsuite/gdb.cp/m-static.exp
+++ b/gdb/testsuite/gdb.cp/m-static.exp
@@ -56,16 +56,16 @@ gdb_continue_to_breakpoint "end of constructors"
# One.
# simple object, static const bool
-gdb_test "print test1.test" "\\$\[0-9\]* = true" "simple object, static const bool"
+gdb_test "print test1.test" "${::valnum_re} = true" "simple object, static const bool"
# simple object, static const int
-gdb_test "print test1.key1" "\\$\[0-9\]* = 5" "simple object, static const int"
+gdb_test "print test1.key1" "${::valnum_re} = 5" "simple object, static const int"
# simple object, static long
-gdb_test "print test1.key2" "\\$\[0-9\]* = 77" "simple object, static long"
+gdb_test "print test1.key2" "${::valnum_re} = 77" "simple object, static long"
# simple object, static enum
-gdb_test "print test1.value" "\\$\[0-9\]* = oriental" "simple object, static enum"
+gdb_test "print test1.value" "${::valnum_re} = oriental" "simple object, static enum"
if { [is_aarch32_target] } {
gdb_test "print test5.single_constructor" \
@@ -130,13 +130,13 @@ if { [is_aarch32_target] } {
# Two.
# derived template object, base static const bool
-gdb_test "print test2.test" "\\$\[0-9\]* = true" "derived template object, base static const bool"
+gdb_test "print test2.test" "${::valnum_re} = true" "derived template object, base static const bool"
# derived template object, base static const int
-gdb_test "print test2.key1" "\\$\[0-9\]* = 5" "derived template object, base static const int"
+gdb_test "print test2.key1" "${::valnum_re} = 5" "derived template object, base static const int"
# derived template object, base static long
-gdb_test "print test2.key2" "\\$\[0-9\]* = 77" "derived template object, base static long"
+gdb_test "print test2.key2" "${::valnum_re} = 77" "derived template object, base static long"
# derived template object, base static enum
gdb_test "print test2.value" "\\$\[0-9\].* = oriental" "derived template object, base static enum"
diff --git a/gdb/testsuite/gdb.cp/method.exp b/gdb/testsuite/gdb.cp/method.exp
index 4f05e5c0efa..d890be1df9e 100644
--- a/gdb/testsuite/gdb.cp/method.exp
+++ b/gdb/testsuite/gdb.cp/method.exp
@@ -57,13 +57,13 @@ gdb_test "continue" \
# Check ability to access this-relative stuff.
gdb_test "print x" \
- "\\$\[0-9\]* = 20" \
+ "${::valnum_re} = 20" \
"print x in A::foo"
# Check access to this pointer
gdb_test "print this" \
- "\\$\[0-9\]* = \\((class |)A *\\* *(const|)\\) $hex" \
+ "${::valnum_re} = \\((class |)A *\\* *(const|)\\) $hex" \
"print this in A::foo"
# Now do everything over again for A::bar, because sometimes processing one method
@@ -79,7 +79,7 @@ gdb_test "continue" \
# Check ability to access this-relative stuff.
gdb_test "print x" \
- "\\$\[0-9\]* = 33" \
+ "${::valnum_re} = 33" \
"print x in A::bar"
# Check access to this pointer
@@ -87,17 +87,17 @@ gdb_test "print x" \
get_debug_format
gdb_test_multiple "print this" "print this in A::bar" {
- -re "\\$\[0-9\]* = \\(const (class |)A *\\* *(const|)\\) $hex\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = \\(const (class |)A *\\* *(const|)\\) $hex\r\n$gdb_prompt $" {
pass "print this in A::bar"
}
- -re "\\$\[0-9\]* = \\((class |)A *\\* *(const|)\\) $hex\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = \\((class |)A *\\* *(const|)\\) $hex\r\n$gdb_prompt $" {
# gcc versions up to 3.0.4 with -gstabs+ do not emit "const"
# indicators, so the output is "A *". It should be "const A
# *" or "const A * const".
setup_xfail_format "stabs"
fail "print this in A::bar (missing const)"
}
- -re "\\$\[0-9\]* = \\(const (class |)\{\\.\\.\\.\} *\\* *(const|)\\) $hex\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = \\(const (class |)\{\\.\\.\\.\} *\\* *(const|)\\) $hex\r\n$gdb_prompt $" {
# gcc versions gcc-3_1-branch%20020404 and HEAD%20020404 with -gstabs+
# produce good stabs, but gdb prints "const class {...} *" const.
# This is PR gdb/277.
@@ -120,19 +120,19 @@ gdb_test "continue" \
# Check ability to access this-relative stuff.
gdb_test "print data_" \
- "\\$\[0-9\]* = 33" \
+ "${::valnum_re} = 33" \
"print data_ in funk::getFunky"
# Check access to this pointer
gdb_test "print this" \
- "\\$\[0-9\]* = \\((class |)funk *\\* *(const|)\\) $hex" \
+ "${::valnum_re} = \\((class |)funk *\\* *(const|)\\) $hex" \
"print this in funk::getFunky"
# Check access to local variable
gdb_test "print res" \
- "\\$\[0-9\]* = -30" \
+ "${::valnum_re} = -30" \
"print res in funk::getFunky"
# Check ptype of class -- should show const/volatile methods
diff --git a/gdb/testsuite/gdb.cp/misc.exp b/gdb/testsuite/gdb.cp/misc.exp
index c0de6b7a041..974ad1a550c 100644
--- a/gdb/testsuite/gdb.cp/misc.exp
+++ b/gdb/testsuite/gdb.cp/misc.exp
@@ -67,52 +67,52 @@ proc do_tests {} {
do_tests
test_expr "set language c++" \
- "print 1 == 1" "print.*\\$\[0-9\]* = true" \
- "print 1 == 2" "print.*\\$\[0-9\]* = false" \
+ "print 1 == 1" "print.*${::valnum_re} = true" \
+ "print 1 == 2" "print.*${::valnum_re} = false" \
"print as bool"
# Test bool type printing, etc.
# Note: Language is already set to C++ above!
-gdb_test "print v_bool" "\\$\[0-9\]* = false" "print a bool var"
+gdb_test "print v_bool" "${::valnum_re} = false" "print a bool var"
# set a bool variable
test_expr "set variable v_bool = true" \
- "print v_bool" "\\$\[0-9\]* = true" \
+ "print v_bool" "${::valnum_re} = true" \
"set a bool var"
# next print an array of bool
-gdb_test "print v_bool_array" "\\$\[0-9\]* = \\{false, false\\}" "print a bool array"
+gdb_test "print v_bool_array" "${::valnum_re} = \\{false, false\\}" "print a bool array"
# set elements of a bool array
test_expr "set variable v_bool_array\[1\] = true" \
- "print v_bool_array" "\\$\[0-9\]* = \\{false, true\\}" \
+ "print v_bool_array" "${::valnum_re} = \\{false, true\\}" \
"set a bool array elem"
# bool constants
-gdb_test "print true" "\\$\[0-9\]* = true"
-gdb_test "print false" "\\$\[0-9\]* = false"
+gdb_test "print true" "${::valnum_re} = true"
+gdb_test "print false" "${::valnum_re} = false"
# arithmetic conversions
-gdb_test "print 1 + true" "\\$\[0-9\]* = 2" "1 + true"
-gdb_test "print 3 + false" "\\$\[0-9\]* = 3" "3 + false"
-gdb_test "print 1 < 2 < 3" "\\$\[0-9\]* = true" "1 < 2 < 3"
-gdb_test "print 2 < 1 > 4" "\\$\[0-9\]* = false" "2 < 1 > 4"
-gdb_test "print (bool)43" "\\$\[0-9\]* = true" "(bool)43"
-gdb_test "print (bool)0" "\\$\[0-9\]* = false" "(bool)0"
-gdb_test "print (bool)17.93" "\\$\[0-9\]* = true" "(bool)17.93"
-gdb_test "print (bool)0.0" "\\$\[0-9\]* = false" "(bool)0.0"
-gdb_test "print (int)true" "\\$\[0-9\]* = 1" "(int)true"
-gdb_test "print (int)false" "\\$\[0-9\]* = 0" "(int)false"
+gdb_test "print 1 + true" "${::valnum_re} = 2" "1 + true"
+gdb_test "print 3 + false" "${::valnum_re} = 3" "3 + false"
+gdb_test "print 1 < 2 < 3" "${::valnum_re} = true" "1 < 2 < 3"
+gdb_test "print 2 < 1 > 4" "${::valnum_re} = false" "2 < 1 > 4"
+gdb_test "print (bool)43" "${::valnum_re} = true" "(bool)43"
+gdb_test "print (bool)0" "${::valnum_re} = false" "(bool)0"
+gdb_test "print (bool)17.93" "${::valnum_re} = true" "(bool)17.93"
+gdb_test "print (bool)0.0" "${::valnum_re} = false" "(bool)0.0"
+gdb_test "print (int)true" "${::valnum_re} = 1" "(int)true"
+gdb_test "print (int)false" "${::valnum_re} = 0" "(int)false"
gdb_test "print 'misc.cc'::v_bool" " = true" \
"expression using block qualifier"
# pointer arithmetic
-gdb_test "print *(v_bool_array + number_ref)" "\\$\[0-9\]* = false" \
+gdb_test "print *(v_bool_array + number_ref)" "${::valnum_re} = false" \
"pointer addition with integer reference"
-gdb_test "print *(number_ref + v_bool_array)" "\\$\[0-9\]* = false" \
+gdb_test "print *(number_ref + v_bool_array)" "${::valnum_re} = false" \
"integer reference addition with pointer"
-gdb_test "print *(v_bool_array - number_ref)" "\\$\[0-9\]* = false" \
+gdb_test "print *(v_bool_array - number_ref)" "${::valnum_re} = false" \
"pointer subtraction with integer reference"
# C++14 digit separator.
diff --git a/gdb/testsuite/gdb.cp/namespace.exp b/gdb/testsuite/gdb.cp/namespace.exp
index 5e9bee31239..50fa4c843b1 100644
--- a/gdb/testsuite/gdb.cp/namespace.exp
+++ b/gdb/testsuite/gdb.cp/namespace.exp
@@ -65,10 +65,10 @@ gdb_test "up" ".*main.*" "up from marker1"
# shouldn't work with quotes, I'm only including one version.
gdb_test "print 'AAA::c'" \
- "\\$\[0-9\]* = 0 '\\\\(0|000)'"
+ "${::valnum_re} = 0 '\\\\(0|000)'"
gdb_test "print AAA::c" \
- "\\$\[0-9\]* = 0 '\\\\(0|000)'"
+ "${::valnum_re} = 0 '\\\\(0|000)'"
# An object declared using "using".
@@ -98,10 +98,10 @@ gdb_test_multiple "info func xyzq" "info func xyzq" {
# Call a function in a namespace
gdb_test "print 'AAA::xyzq'('x')" \
- "\\$\[0-9\]* = 97 'a'"
+ "${::valnum_re} = 97 'a'"
gdb_test "print AAA::xyzq('x')" \
- "\\$\[0-9\]* = 97 'a'"
+ "${::valnum_re} = 97 'a'"
# Break on a function in a namespace
@@ -116,10 +116,10 @@ gdb_test "break -qualified ::ensureOtherRefs" \
# Call a function in a nested namespace
gdb_test "print 'BBB::CCC::xyzq'('x')" \
- "\\$\[0-9\]* = 122 'z'"
+ "${::valnum_re} = 122 'z'"
gdb_test "print BBB::CCC::xyzq('x')" \
- "\\$\[0-9\]* = 122 'z'"
+ "${::valnum_re} = 122 'z'"
# Break on a function in a nested namespace
@@ -134,10 +134,10 @@ gdb_test "break ::BBB::CCC::xyzq" \
# Print address of a function in a class in a namespace
gdb_test "print 'BBB::Class::xyzq'" \
- "\\$\[0-9\]* = \{char \\((BBB::|)Class \\*( const|), (char|int)\\)\} $hex <BBB::Class::xyzq\\(char\\)>"
+ "${::valnum_re} = \{char \\((BBB::|)Class \\*( const|), (char|int)\\)\} $hex <BBB::Class::xyzq\\(char\\)>"
gdb_test "print BBB::Class::xyzq" \
- "\\$\[0-9\]* = \{char \\((BBB::|)Class \\*( const|), (char|int)\\)\} $hex <BBB::Class::xyzq\\(char\\)>"
+ "${::valnum_re} = \{char \\((BBB::|)Class \\*( const|), (char|int)\\)\} $hex <BBB::Class::xyzq\\(char\\)>"
# Break on a function in a class in a namespace
diff --git a/gdb/testsuite/gdb.cp/pr-574.exp b/gdb/testsuite/gdb.cp/pr-574.exp
index 1fb3e741407..1952463063f 100644
--- a/gdb/testsuite/gdb.cp/pr-574.exp
+++ b/gdb/testsuite/gdb.cp/pr-574.exp
@@ -52,6 +52,6 @@ gdb_continue_to_breakpoint "end of constructors"
# Different compilers order the data for <A> differently, so I'm not
# matching the result exactly.
-gdb_test "print *theB" "\\$\[0-9\]* = {<A> = {\[^}\]*}, static b = <optimized out>}" "PR gdb/574"
+gdb_test "print *theB" "${::valnum_re} = {<A> = {\[^}\]*}, static b = <optimized out>}" "PR gdb/574"
gdb_exit
diff --git a/gdb/testsuite/gdb.cp/printmethod.exp b/gdb/testsuite/gdb.cp/printmethod.exp
index 8e28233238a..bad147b874d 100644
--- a/gdb/testsuite/gdb.cp/printmethod.exp
+++ b/gdb/testsuite/gdb.cp/printmethod.exp
@@ -43,10 +43,10 @@ gdb_continue_to_breakpoint "end of constructors"
# The first of these is for PR gdb/653.
gdb_test "print theA->virt" \
- "\\$\[0-9\]* = {void \\(A \\* const\\)} $hex <A::virt\\((void|)\\)>" \
+ "${::valnum_re} = {void \\(A \\* const\\)} $hex <A::virt\\((void|)\\)>" \
"print virtual method."
gdb_test "print theA->nonvirt" \
- "\\$\[0-9\]* = {void \\(A \\* const\\)} $hex <A::nonvirt\\((void|)\\)>" \
+ "${::valnum_re} = {void \\(A \\* const\\)} $hex <A::nonvirt\\((void|)\\)>" \
"print nonvirtual method."
gdb_exit
diff --git a/gdb/testsuite/gdb.cp/rtti.exp b/gdb/testsuite/gdb.cp/rtti.exp
index 8a7d02d2730..b694ab935e3 100644
--- a/gdb/testsuite/gdb.cp/rtti.exp
+++ b/gdb/testsuite/gdb.cp/rtti.exp
@@ -59,10 +59,10 @@ gdb_test_multiple "print *e1" "print *e1" {
# gdb 6.0
kfail "gdb/488" "print *e1"
}
- -re "\\$\[0-9\]* = {<n1::Base1> = .*}\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = {<n1::Base1> = .*}\r\n$gdb_prompt $" {
pass "print *e1"
}
- -re "\\$\[0-9\]* = {<Base1> = .*}\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = {<Base1> = .*}\r\n$gdb_prompt $" {
# NOTE: carlton/2003-05-16: If code is compiled by GCC2, we
# don't print the warning (for no particular reason), but we
# still call the class via the wrong name; PR gdb/57 is our
@@ -89,13 +89,13 @@ gdb_test_multiple "print *e2" "print *e2" {
# gdb 6.0
kfail "gdb/488" "print *e2"
}
- -re "\\$\[0-9\]* = <incomplete type>\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = <incomplete type>\r\n$gdb_prompt $" {
kfail "gdb/1511" "print *e2"
}
- -re "\\$\[0-9\]* = {<n2::Base2> = .*}\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = {<n2::Base2> = .*}\r\n$gdb_prompt $" {
pass "print *e2"
}
- -re "\\$\[0-9\]* = {<Base2> = .*}\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = {<Base2> = .*}\r\n$gdb_prompt $" {
kfail "gdb/57" "print *e2"
}
}
@@ -106,11 +106,11 @@ gdb_test_multiple "print *e2" "print *e2" {
gdb_breakpoint [gdb_get_line_number "func-constructs-done" "$srcfile"]
gdb_continue_to_breakpoint "end of constructors in func"
-gdb_test "print *obj" "\\$\[0-9\]* = {<n2::Base2> = .*}"
+gdb_test "print *obj" "${::valnum_re} = {<n2::Base2> = .*}"
gdb_breakpoint [gdb_get_line_number "func3-constructs-done" "$srcfile"]
gdb_continue_to_breakpoint "end of constructors in func3"
-gdb_test "print *obj3" "\\$\[0-9\]* = {<n2::C2> = .*}"
+gdb_test "print *obj3" "${::valnum_re} = {<n2::C2> = .*}"
gdb_exit
diff --git a/gdb/testsuite/gdb.cp/templates.exp b/gdb/testsuite/gdb.cp/templates.exp
index 6598df34425..3531b231e5d 100644
--- a/gdb/testsuite/gdb.cp/templates.exp
+++ b/gdb/testsuite/gdb.cp/templates.exp
@@ -279,12 +279,12 @@ gdb_breakpoint [gdb_get_line_number "Final breakpoint"]
gdb_continue_to_breakpoint "Final breakpoint"
gdb_test "print fint" \
- "\\$\[0-9\]* = \\{x = 0, t = 0\\}"
+ "${::valnum_re} = \\{x = 0, t = 0\\}"
# Prevent symbol on address 0x0 being printed.
gdb_test_no_output "set print symbol off"
gdb_test "print fvpchar" \
- "\\$\[0-9\]* = \\{x = 0, t = 0x0\\}"
+ "${::valnum_re} = \\{x = 0, t = 0x0\\}"
# Template Foo<T>
@@ -356,7 +356,7 @@ gdb_test_multiple "ptype/r fvpchar" "ptype fvpchar" {
# varying the spacing, because of PR gdb/7138.
gdb_test_multiple "print Foo<volatile char *>::foo" "print Foo<volatile char *>::foo" {
- -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<(volatile char|char volatile) ?\\*> \\*(| const), int, .*char \\*\\)\\} $hex <Foo<.*char.*\\*>::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = \\{.*char \\*\\((class |)Foo<(volatile char|char volatile) ?\\*> \\*(| const), int, .*char \\*\\)\\} $hex <Foo<.*char.*\\*>::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" {
pass "print Foo<volatile char *>::foo"
}
-re "No symbol \"Foo<volatile char \\*>\" in current context.\r\n$gdb_prompt $" {
@@ -366,7 +366,7 @@ gdb_test_multiple "print Foo<volatile char *>::foo" "print Foo<volatile char *>:
}
gdb_test_multiple "print Foo<volatile char*>::foo" "print Foo<volatile char*>::foo" {
- -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<(volatile char|char volatile) ?\\*> \\*(| const), int, .*char \\*\\)\\} $hex <Foo<.*char.*\\*>::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = \\{.*char \\*\\((class |)Foo<(volatile char|char volatile) ?\\*> \\*(| const), int, .*char \\*\\)\\} $hex <Foo<.*char.*\\*>::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" {
pass "print Foo<volatile char*>::foo"
}
-re "No symbol \"Foo<volatile char\\*>\" in current context.\r\n$gdb_prompt $" {
@@ -601,7 +601,7 @@ gdb_test_multiple "ptype/r Garply<Garply<char> >" "ptype Garply<Garply<char> >"
# print out a function from a nested template name
gdb_test "print Garply<Garply<char> >::garply" \
- "\\$\[0-9\]* = \\{(class |)Garply<char> \\((class |)Garply<Garply<char> > \\*(| const), int, (class |)Garply<char>\\)\\} $hex <Garply<Garply<char>\[ \t\]*>::garply\\(int, (class |)Garply<char>\\)>"
+ "${::valnum_re} = \\{(class |)Garply<char> \\((class |)Garply<Garply<char> > \\*(| const), int, (class |)Garply<char>\\)\\} $hex <Garply<Garply<char>\[ \t\]*>::garply\\(int, (class |)Garply<char>\\)>"
# djb - 06-03-2000
# Now should work fine
diff --git a/gdb/testsuite/gdb.cp/userdef.exp b/gdb/testsuite/gdb.cp/userdef.exp
index 4a7fa0304f2..68362fed2b0 100644
--- a/gdb/testsuite/gdb.cp/userdef.exp
+++ b/gdb/testsuite/gdb.cp/userdef.exp
@@ -40,7 +40,7 @@ gdb_test "cont" \
gdb_test "up" " in main .*" "up from marker1"
-gdb_test "print one + two" "\\\$\[0-9\]* = {x = 6, y = 8}"
+gdb_test "print one + two" "${::valnum_re} = {x = 6, y = 8}"
# If GDB fails to restore the selected frame properly after the
# inferior function call above (see GDB PR 1155 for an explanation of
@@ -59,74 +59,74 @@ gdb_test_multiple "frame" "re-selected 'main' frame after inferior call" {
}
}
-gdb_test "print one - two" "\\\$\[0-9\]* = {x = -2, y = -2}"
+gdb_test "print one - two" "${::valnum_re} = {x = -2, y = -2}"
-gdb_test "print one * two" "\\\$\[0-9\]* = {x = 8, y = 15}"
+gdb_test "print one * two" "${::valnum_re} = {x = 8, y = 15}"
-gdb_test "print one / two" "\\\$\[0-9\]* = {x = 0, y = 0}"
+gdb_test "print one / two" "${::valnum_re} = {x = 0, y = 0}"
-gdb_test "print one % two" "\\\$\[0-9\]* = {x = 2, y = 3}"
+gdb_test "print one % two" "${::valnum_re} = {x = 2, y = 3}"
-gdb_test "print one && two" "\\\$\[0-9\]* = 1"
+gdb_test "print one && two" "${::valnum_re} = 1"
-gdb_test "print one || two" "\\\$\[0-9\]* = 1"
+gdb_test "print one || two" "${::valnum_re} = 1"
-gdb_test "print one & two" "\\\$\[0-9\]* = {x = 0, y = 1}"
+gdb_test "print one & two" "${::valnum_re} = {x = 0, y = 1}"
-gdb_test "print one | two" "\\\$\[0-9\]* = {x = 6, y = 7}"
+gdb_test "print one | two" "${::valnum_re} = {x = 6, y = 7}"
-gdb_test "print one ^ two" "\\\$\[0-9\]* = {x = 6, y = 6}"
+gdb_test "print one ^ two" "${::valnum_re} = {x = 6, y = 6}"
-gdb_test "print one < two" "\\\$\[0-9\]* = 1"
+gdb_test "print one < two" "${::valnum_re} = 1"
-gdb_test "print one <= two" "\\\$\[0-9\]* = 1"
+gdb_test "print one <= two" "${::valnum_re} = 1"
-gdb_test "print one > two" "\\\$\[0-9\]* = 0"
+gdb_test "print one > two" "${::valnum_re} = 0"
-gdb_test "print one >= two" "\\\$\[0-9\]* = 0"
+gdb_test "print one >= two" "${::valnum_re} = 0"
-gdb_test "print one == two" "\\\$\[0-9\]* = 0"
-gdb_test "print one.operator== (two)" "\\\$\[0-9\]* = 0"
+gdb_test "print one == two" "${::valnum_re} = 0"
+gdb_test "print one.operator== (two)" "${::valnum_re} = 0"
-gdb_test "print one != two" "\\\$\[0-9\]* = 1"
+gdb_test "print one != two" "${::valnum_re} = 1"
# Can't really check the output of this one without knowing
# target integer width. Make sure we don't try to call
# the iostreams operator instead, though.
-gdb_test "print one << 31" "\\\$\[0-9\]* = {x = -?\[0-9\]*, y = -?\[0-9\]*}"
+gdb_test "print one << 31" "${::valnum_re} = {x = -?\[0-9\]*, y = -?\[0-9\]*}"
# Should be fine even on < 32-bit targets.
-gdb_test "print one >> 31" "\\\$\[0-9\]* = {x = 0, y = 0}"
+gdb_test "print one >> 31" "${::valnum_re} = {x = 0, y = 0}"
-gdb_test "print !one" "\\\$\[0-9\]* = 0"
+gdb_test "print !one" "${::valnum_re} = 0"
# Assumes 2's complement. So does everything...
-gdb_test "print +one" "\\\$\[0-9\]* = {x = 2, y = 3}"
+gdb_test "print +one" "${::valnum_re} = {x = 2, y = 3}"
-gdb_test "print ~one" "\\\$\[0-9\]* = {x = -3, y = -4}"
+gdb_test "print ~one" "${::valnum_re} = {x = -3, y = -4}"
-gdb_test "print -one" "\\\$\[0-9\]* = {x = -2, y = -3}"
+gdb_test "print -one" "${::valnum_re} = {x = -2, y = -3}"
-gdb_test "print one++" "\\\$\[0-9\]* = {x = 2, y = 4}"
+gdb_test "print one++" "${::valnum_re} = {x = 2, y = 4}"
-gdb_test "print ++one" "\\\$\[0-9\]* = {x = 3, y = 4}"
+gdb_test "print ++one" "${::valnum_re} = {x = 3, y = 4}"
-gdb_test "print one--" "\\\$\[0-9\]* = {x = 3, y = 3}"
+gdb_test "print one--" "${::valnum_re} = {x = 3, y = 3}"
-gdb_test "print --one" "\\\$\[0-9\]* = {x = 2, y = 3}"
+gdb_test "print --one" "${::valnum_re} = {x = 2, y = 3}"
-gdb_test "print one += 7" "\\\$\[0-9\]* = {x = 9, y = 10}"
+gdb_test "print one += 7" "${::valnum_re} = {x = 9, y = 10}"
-gdb_test "print two = one" "\\\$\[0-9\]* = {x = 9, y = 10}"
+gdb_test "print two = one" "${::valnum_re} = {x = 9, y = 10}"
# Check that GDB tolerates whitespace in operator names.
gdb_test "break A2::operator+" ".*Breakpoint $decimal at.*"
gdb_test "break A2::operator +" ".*Breakpoint $decimal at.*"
# Check that GDB handles operator* correctly.
-gdb_test "print c" "\\\$\[0-9\]* = {m = {z = .*}}"
-gdb_test "print *c" "\\\$\[0-9\]* = \\(Member &\\) @$hex: {z = .*}"
-gdb_test "print &*c" "\\\$\[0-9\]* = \\(Member \\*\\) $hex"
+gdb_test "print c" "${::valnum_re} = {m = {z = .*}}"
+gdb_test "print *c" "${::valnum_re} = \\(Member &\\) @$hex: {z = .*}"
+gdb_test "print &*c" "${::valnum_re} = \\(Member \\*\\) $hex"
gdb_test "ptype &*c" "type = (struct|class) Member {(\[\r\n \]+public:)?\[\r\n \]+int z;\[\r\n\].*} \\*"
gdb_test "print operator== (mem1, mem2)" " = false"
diff --git a/gdb/testsuite/gdb.opt/fortran-string.exp b/gdb/testsuite/gdb.opt/fortran-string.exp
index 9025f090927..ac0e6f31802 100644
--- a/gdb/testsuite/gdb.opt/fortran-string.exp
+++ b/gdb/testsuite/gdb.opt/fortran-string.exp
@@ -34,4 +34,4 @@ if {![runto f]} {
gdb_test_no_output "set print frame-arguments all"
gdb_test "frame" ".*s='foo'.*"
gdb_test "ptype s" "type = character\\*3"
-gdb_test "p s" "\\$\[0-9\]* = 'foo'"
+gdb_test "p s" "${::valnum_re} = 'foo'"
diff --git a/gdb/testsuite/gdb.threads/continue-pending-status.exp b/gdb/testsuite/gdb.threads/continue-pending-status.exp
index 843835d22f2..1ffa6fd3242 100644
--- a/gdb/testsuite/gdb.threads/continue-pending-status.exp
+++ b/gdb/testsuite/gdb.threads/continue-pending-status.exp
@@ -39,7 +39,7 @@ proc get_current_thread {} {
set thread ""
set msg "get thread number"
gdb_test_multiple "print /x \$_thread" $msg {
- -re "\\$\[0-9\]* = (0x\[0-9a-zA-Z\]+).*$gdb_prompt $" {
+ -re "${::valnum_re} = (0x\[0-9a-zA-Z\]+).*$gdb_prompt $" {
set thread $expect_out(1,string)
pass "$msg"
}
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index f6bdfcdb60c..594cb115fe3 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -9418,7 +9418,7 @@ proc get_valueof { fmt exp default {test ""} } {
set val ${default}
gdb_test_multiple "print${fmt} ${exp}" "$test" {
- -re -wrap "^\\$\[0-9\]* = (\[^\r\n\]*)" {
+ -re -wrap "^${::valnum_re} = (\[^\r\n\]*)" {
set val $expect_out(1,string)
pass "$test"
}
@@ -9467,7 +9467,7 @@ proc get_integer_valueof { exp default {test ""} } {
set val ${default}
gdb_test_multiple "print /d ${exp}" "$test" {
- -re -wrap "^\\$\[0-9\]* = (\[-\]*\[0-9\]*).*" {
+ -re -wrap "^${::valnum_re} = (\[-\]*\[0-9\]*).*" {
set val $expect_out(1,string)
pass "$test"
}
@@ -9492,7 +9492,7 @@ proc get_hexadecimal_valueof { exp default {test ""} } {
set val ${default}
gdb_test_multiple "print /x ${exp}" $test {
- -re "\\$\[0-9\]* = (0x\[0-9a-zA-Z\]+).*$gdb_prompt $" {
+ -re "${::valnum_re} = (0x\[0-9a-zA-Z\]+).*$gdb_prompt $" {
set val $expect_out(1,string)
pass "$test"
}
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index 1dc389dea71..2e3a61d484b 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -2897,7 +2897,7 @@ proc mi_get_valueof { fmt exp default {test ""} } {
set val ${default}
gdb_test_multiple "print${fmt} ${exp}" "$test" -prompt "$::mi_gdb_prompt$" {
- -re "~\"\\$\[0-9\]* = (\[^\r\n\]*)\\\\n\"\r\n\\^done\r\n$mi_gdb_prompt$" {
+ -re "~\"${::valnum_re} = (\[^\r\n\]*)\\\\n\"\r\n\\^done\r\n$mi_gdb_prompt$" {
set val $expect_out(1,string)
pass "$test"
}
--
2.51.0
^ permalink raw reply [flat|nested] 8+ messages in thread