]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Use valnum_re more often (part 1)
authorTom de Vries <tdevries@suse.de>
Mon, 2 Feb 2026 20:36:48 +0000 (21:36 +0100)
committerTom de Vries <tdevries@suse.de>
Mon, 2 Feb 2026 20:36:48 +0000 (21:36 +0100)
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 '\\\$'.

Approved-by: Kevin Buettner <kevinb@redhat.com>
87 files changed:
gdb/testsuite/gdb.ada/array_return.exp
gdb/testsuite/gdb.ada/formatted_ref.exp
gdb/testsuite/gdb.ada/operator_call.exp
gdb/testsuite/gdb.arch/aarch64-gcs-core.exp
gdb/testsuite/gdb.arch/aarch64-mte.exp
gdb/testsuite/gdb.arch/amd64-shadow-stack-corefile.exp
gdb/testsuite/gdb.arch/iwmmxt-regs.exp
gdb/testsuite/gdb.arch/mips-fcr.exp
gdb/testsuite/gdb.arch/mips16-thunks.exp
gdb/testsuite/gdb.arch/powerpc-d128-regs.exp
gdb/testsuite/gdb.arch/s390-tdbregs.exp
gdb/testsuite/gdb.base/args.exp
gdb/testsuite/gdb.base/bitshift.exp
gdb/testsuite/gdb.base/bp-cmds-sourced-script.exp
gdb/testsuite/gdb.base/charset.exp
gdb/testsuite/gdb.base/code_elim.exp
gdb/testsuite/gdb.base/coredump-filter.exp
gdb/testsuite/gdb.base/corefile.exp
gdb/testsuite/gdb.base/debug-expr.exp
gdb/testsuite/gdb.base/dump.exp
gdb/testsuite/gdb.base/finish.exp
gdb/testsuite/gdb.base/frameapply.exp
gdb/testsuite/gdb.base/func-ptrs.exp
gdb/testsuite/gdb.base/gnu_vector.exp
gdb/testsuite/gdb.base/infnan.exp
gdb/testsuite/gdb.base/interact.exp
gdb/testsuite/gdb.base/multi-line-starts-subshell.exp
gdb/testsuite/gdb.base/new-ui.exp
gdb/testsuite/gdb.base/non-lazy-array-index.exp
gdb/testsuite/gdb.base/overlays.exp
gdb/testsuite/gdb.base/prologue.exp
gdb/testsuite/gdb.base/ptr-typedef.exp
gdb/testsuite/gdb.base/randomize.exp
gdb/testsuite/gdb.base/range-stepping.exp
gdb/testsuite/gdb.base/relocate.exp
gdb/testsuite/gdb.base/scope.exp
gdb/testsuite/gdb.base/set-cwd.exp
gdb/testsuite/gdb.base/share-env-with-gdbserver.exp
gdb/testsuite/gdb.base/shell.exp
gdb/testsuite/gdb.base/signals.exp
gdb/testsuite/gdb.base/solib-disc.exp
gdb/testsuite/gdb.base/startup-with-shell.exp
gdb/testsuite/gdb.base/structs3.exp
gdb/testsuite/gdb.base/style.exp
gdb/testsuite/gdb.cp/bs15503.exp
gdb/testsuite/gdb.cp/call-c.exp
gdb/testsuite/gdb.cp/classes.exp
gdb/testsuite/gdb.cp/converts.exp
gdb/testsuite/gdb.cp/cp-relocate.exp
gdb/testsuite/gdb.cp/ctti.exp
gdb/testsuite/gdb.cp/derivation.exp
gdb/testsuite/gdb.cp/formatted-ref.exp
gdb/testsuite/gdb.cp/inherit.exp
gdb/testsuite/gdb.cp/member-ptr.exp
gdb/testsuite/gdb.cp/method-ref-return.exp
gdb/testsuite/gdb.cp/namespace.exp
gdb/testsuite/gdb.cp/overload.exp
gdb/testsuite/gdb.cp/static-print-quit.exp
gdb/testsuite/gdb.cp/virtfunc.exp
gdb/testsuite/gdb.cp/virtfunc2.exp
gdb/testsuite/gdb.fortran/debug-expr.exp
gdb/testsuite/gdb.fortran/derived-type.exp
gdb/testsuite/gdb.fortran/namelist.exp
gdb/testsuite/gdb.fortran/subarray.exp
gdb/testsuite/gdb.mi/user-selected-context-sync.exp
gdb/testsuite/gdb.multi/tids.exp
gdb/testsuite/gdb.opt/clobbered-registers-O2.exp
gdb/testsuite/gdb.opt/inline-cmds.exp
gdb/testsuite/gdb.opt/inline-locals.exp
gdb/testsuite/gdb.opt/static-optimized-out.exp
gdb/testsuite/gdb.server/ext-wrapper.exp
gdb/testsuite/gdb.server/inferior-args.exp
gdb/testsuite/gdb.server/wrapper.exp
gdb/testsuite/gdb.threads/infcall-thread-announce.exp
gdb/testsuite/gdb.threads/pthreads.exp
gdb/testsuite/gdb.threads/reconnect-signal.exp
gdb/testsuite/gdb.threads/schedlock.exp
gdb/testsuite/gdb.threads/thread-bp-deleted.exp
gdb/testsuite/gdb.threads/threadapply.exp
gdb/testsuite/gdb.threads/tls-core.exp
gdb/testsuite/gdb.trace/collection.exp
gdb/testsuite/gdb.trace/disconnected-tracing.exp
gdb/testsuite/gdb.trace/report.exp
gdb/testsuite/gdb.trace/stap-trace.exp
gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp
gdb/testsuite/gdb.trace/unavailable.exp
gdb/testsuite/lib/gdb.exp

index 11cd1736c64da9bb112766ea7b67f77573b3f914..dab9bf8a3d458d1e48e6c298591a709f5a2492ca 100644 (file)
@@ -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"
index 87efa78f5f1f1ca1f50283d07f5be304cf64af6c..0051ca95fecf00829db9635b43688b72fbc4ad8b 100644 (file)
@@ -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}
index 24b3ab57240207772da4a6a724c778b94ebcc2a2..5eb98f9f834906b6c83c16ec4fc38929f62b6312 100644 (file)
@@ -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 {
index d6aefbfb4037274a45ed0cfa1fc6b8e8a94cd4f5..30a620ed06b3f72cc789b4a9f4d433a644c8f068 100644 (file)
@@ -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"
 }
 
index 99f1320da3874b97125872265e46fb4d3ce0b9cd..4da3810957390ab578d3a6ce6c96eb3534fdd96b 100644 (file)
@@ -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"
 }
 
index 0a8f3959049310ccd72fd4f27d791868d0fd2b0b..754f59b3e04de227e553bc03921e807b75e6906c 100644 (file)
@@ -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"
 }
 
index 5e1af998bf56c04e1477994ba0791f6cbbe4b5ad..6c1848593b2182b00e55e794f70c75d118de77d6 100644 (file)
@@ -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"
 }
index b24f7fe52439a10040c56c0528f04cb05b507e9f..2cb22004946c2d667047426435f63650de6c8fc1 100644 (file)
@@ -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"
index 3ef044890c6b111df41c55381436e948d88dfa08..f8d485a08ded5bf6b76de33491c9197234ca3080 100644 (file)
@@ -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 $" {
index 1140563d09f3dcdf77211e73e638e28a80772467..05ae31877e1b8b98509d9716279f9820d752a045 100644 (file)
@@ -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\\)" \
index be217559a286fc849d5c64bc07cf6f0fcdf8d66e..1225762a1ab3467b9285855f2715682e5daeaf24 100644 (file)
@@ -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>" \
index bc52701e38a5830c7eb4b0a6146a25930b7ed169..bd10c90b6cd73ade677fa540873704ba5bc4ea98 100644 (file)
@@ -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}]
                }
index 3af6614b26fa00ddba2daf486e5cd168de6236bb..4066cf5b2f8ad6ce28bdcc52ca84c99c4204a058 100644 (file)
@@ -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
            }
        }
index 62c3ac7ed855c8a7c8c50d9f50d4f756caf8b945..e12016f2fc5ea254854c62f3fcbc7cacbedc5c44 100644 (file)
@@ -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
     }
 }
index e8c225bb43821085cf2b73fbbca6dc8bda44c103..9148fec57e846eaf945b7340b8a3dd6806bcd987 100644 (file)
@@ -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 $" {
index cac745ab8a3f5cf398f3bb5955742d02eb45ba5c..86714346201dd9f81a90eda3f85441cedb745344 100644 (file)
@@ -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}"
        }
     }
index c93c0c4816219d76a6e1eba3a6252e2594c59a3d..c35a0334ff3310ba480141048d632af63ae30091 100644 (file)
@@ -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)"
index fcc9b7b284a8e3e2b021cba26a14501f395fd5ec..957bccf43a40ac1c14e5577a1a70789ad458fa6f 100644 (file)
@@ -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,
index 54389bc868379a721961b882695c7187587802fb..80f6d5a968b1eada3c82cdff0800f6fe04c48d7c 100644 (file)
@@ -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"
index 341e6e556913ee97eff76d80a585400e3c941610..427161d4d91935cf5149e846c6cc9b695cc029ca 100644 (file)
@@ -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.
index 3c82305086fa112f8b9c98438c4c191f9145b5a3..43719cb9fc504a908dc821d01f55bb18fa9b796e 100644 (file)
@@ -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"
 }
index 04459031c3d6bbd9deedd30d76095e6bac109374..73650052ad9ed6aa7f7b2c9e23dc36847ecba35b 100644 (file)
@@ -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"
        }
 }
index fc411b8e95820c40671a2a61db9bde9e3ae0ff5d..66c3daac7a91382dd7776ff0365f0e8a424038f4 100644 (file)
@@ -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"
 
 
index a8be307255546ef6a5e4778edade18a9cff237c7..c1616fd32750fc751b983052b2f3d0338cefaaca 100644 (file)
@@ -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"
index cc9000d176f6ba1e62982a8ab2ae9c30f66265e3..18a0d235525d7e265dbc5a722ac92f24ee815121 100644 (file)
@@ -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.*\\)"
index 4b5381316472f3ce28da3bae78200742010ce9d7..70a9825cb582a4171f851a406376bad3c8c71066 100644 (file)
@@ -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.
index 6bf315b78810b9d8258cf6d500192bb429588220..be54828186998f01686c7bdd88366f754b2a2122 100644 (file)
@@ -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"
index 6380f1739661d8d111da78f320f7cc6fee69a9ac..6bc45392733cd57368154670ece94f079fad0e05 100644 (file)
@@ -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
index d21b80b6d6d0d9082addf52d41252147d985621a..48eb7db77c11579ceb9620dddda261e6a16af72d 100644 (file)
@@ -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
index d45412ba696798e49c095c2a7410e9fbdf49a9ad..3f584ee83c3a7225bd5ab1174c33535b05edd763 100644 (file)
@@ -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"
        }
index b8fd232a549b8319d8b16cbe63f58ed34e53d847..cd7c1bf8e4a86bd24731b0a5c6add5ad30c33d6c 100644 (file)
@@ -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"
index fbb4b48dde7f5099cc0b3456a710af9db33a25b9..5dfd96d12ea7bdada31f66b02f70c2b3c94f7dbd 100644 (file)
@@ -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"
index d9198e1272bdee7915428ce367476b187fa39b6e..52c2ff71ab127bd2075378a04bf06e5d8800491b 100644 (file)
@@ -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)
        }
index 531687df96696b948cd2da2f6e961a92bd894f4a..53083f066c352d562463e0f18da624f996bf3f3c 100644 (file)
@@ -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
        }
index 99e8cb67448baea78b7dea51b7dfaad66fdf3ba7..8c1ffc52e5091589eb7d36e46ca0223de05f691c 100644 (file)
@@ -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"
index 9430c4bf59c448581eb7ae4cb76a522c99a46c2c..b82465a1184d8d52a8c7c3ec87ee3ceb78a32622 100644 (file)
@@ -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.
index a45ffd4a7431e9a86b665c443efa8b45b49a57d6..3fbffdc6136f0524b3bce146d9d13d450ed0c911 100644 (file)
@@ -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"
     }
 }
index 238f113119e8df04cb051294b553dd077754ecba..e1b3540d5d7eb8681cb128e51b9fd5169d0e95c1 100644 (file)
@@ -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
        }
     }
index 71d95d4212268a5c0b7abec1a09c7d6458917da7..f6b36dc3a7ca7f71f985770da2610a2ea28276b0 100644 (file)
@@ -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
index 51adb19e6138d898120d522da6ad340e77e4e188..5ce3ff12d579aabe90f4c12ea7eb7de9be59d182 100644 (file)
@@ -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
index e289869987777579d1be503d412732167454f448..a9b2bd471eea46d930d386f62f2e6f2e8f487121 100644 (file)
@@ -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"
index 5a9b69e9b9e7090cd9d37aa89e60cf1680e2a629..b27cdce63d733a497447a69c23c90cbd3f65e439 100644 (file)
@@ -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
        }
     }
 }
index 4eea63b4305b47421ce2c6071cfc99297a7a14aa..bdcf19a9932b8c5e09194d2a4bbbfff3a9d1ce0d 100644 (file)
@@ -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}"
index 23d50f4cfadfc512977167f4e85741cd104a1721..2bffe8cf437228431a215237340f1fc54ddbae57 100644 (file)
@@ -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
index f48d692ca25b753e77edb66369828d35f86c5a40..3a1ec22b5a430c1282677df982d08c392d838cfb 100644 (file)
@@ -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\""
index 8cb487a6092a11179bfe323e407986def01a5dce..bdbe42772397dfa578a715217256cfbfe1af8594 100644 (file)
@@ -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"
index 231c6c7cff228118b7d2748036fe95246d00e7de..ea4b2033b830cc1dd0f77084fdc236add1dfdd51 100644 (file)
@@ -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" \
index abc583c52992b053d759e926de830181df9ed0be..7d26db9f3022dad3826f2923b573724593423e10 100644 (file)
@@ -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
   }
 }
index 8866324148f1b1dc5470298124d1c536d1ffd873..fb45313466b11fdc62f45cbee91c0b7b0c90f137 100644 (file)
@@ -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}"
index 941143c81b796002c472b06dca6446dc679fb71d..e328b7c59c4125ddf7d54b2a094352c7dd365c93 100644 (file)
@@ -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 $" {
index 1e727a7cc8286baeb335f2a5d851d72e2c226be6..34fbf3c250e1d73d31ae1fefddf098c188b36137 100644 (file)
@@ -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"} {
index 3e4a76c1a8a1b07196fa5254e78752f69a9bd49c..cecc3876b5a7cae36c03593a328134938156b4c6 100644 (file)
@@ -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"]
index f3c7a23f4e27595164a9f999b54dc60a09e620dc..eafec26828f33234485376f95b4efb3ac4060271 100644 (file)
@@ -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
 
index bce11019fd2c7dbbe0af49b8637aa7a8cf6f0a25..f7aa475d4f816f1f3a5171484347a8931363a4c9 100644 (file)
@@ -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
 
index 2e75d5b663641bd0d4bbd58d16c42d22e031c701..8f3638172c380b296b2acb70876ad9afc78da9ed 100644 (file)
@@ -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
index 7ba3efb9ba419806fa1bd45a000ab639f249f755..5e9bee31239b561b4db1c5e5ea70429897bf5a50 100644 (file)
@@ -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 $" {
index c017ae1a55e6ee1ae4efd3e0aef0401ce8b2ac58..5d586b19e2446ca3bc60ec0ab8e44427d3f1ae89 100644 (file)
@@ -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\\)>"
 }
index 7a26f4b9cd87a12d7fff706dd7717357810042a6..088abb9b9f8ef97f2533f7a3df3fffa52cd598e5 100644 (file)
@@ -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$" {
index ffacc77e6f44ae85dbb41b1d45713169f5e3ad53..21e300e4ffc9b29bbcf04ef6fd0fa1e3f0f3e5a6 100644 (file)
@@ -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,
index 598fe4304b3720caf806f5ab1370590519445a5e..761453f6227e43e81821639a7157658faa9bbf85 100644 (file)
@@ -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>}"
 
index 638624b343817c0d94ef699361820ca788d30883..4cd78c7d478a0b0ba77b2e762ce2b37ca5237b0b 100644 (file)
@@ -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\."]
index 6e05b3229f46510c74915a779c02f98998328de8..c55ebb338e2d0a003b36006987bd4e76b546d917 100644 (file)
@@ -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 $"
index 3f60fb1475d0f9ab74bb2b8fff799142154acfe2..25c9ae920a68cd926ef82760a42d9ff12fc276a0 100644 (file)
@@ -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\\."
index 9bd4698050c961a71f2b91afe6d9a926ec0e7994..f8677168b33257f96d1afea504dcae0d576e3267 100644 (file)
@@ -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\\)"
index 3434ffa2a461068f136ac1507431018929ff23a7..844206f75116e7a8d0d094a0b0fb83cdb4cacd46 100644 (file)
@@ -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
index 2d843a05f5d07613d75fbd34afe25a515fb64469..be42fcbffd0575dac913f860e4bb5ed79b9696b8 100644 (file)
@@ -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"
index 72eceb8b91d80e43bf187307e8b66f633b1ee1f1..f36bb62a78ac524b836644b4444b2751aaa6e2f9 100644 (file)
@@ -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" }
 }
index 8f1005adf36b1e14728377b10d16f33d9026bb68..12db0709fe691c9130a9aea0369556e37bc46a2c 100644 (file)
@@ -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 $" { }
index a2671648b3b96eec5c38ab86cc208ec27d32ab37..2c3a9f71c2fb1472b6670f4c8577c198c9f0a776 100644 (file)
@@ -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.
 
index 6b2a94e67601626b72f3c63b6dcafdeed848fd02..92a5d2836d600272dc4a643bc62b0cf51bbf614f 100644 (file)
@@ -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)
     }
 }
index ad4dd66022857404c9c20c410bfb079ee660eda4..836c32a757456daf098add3481f304d6b6dc7a23 100644 (file)
@@ -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"
index a9244dbed709deec7f8c8729cd665d76983e86e3..312e756f0d80ff72e86cf0930ce54a03d747e9b1 100644 (file)
@@ -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
     }
index d577f29f7447e02a88b80a3bbdb688b2ba1538e8..9478640c40e2a92e5e80e2ed1e0a17d859a5fe57 100644 (file)
@@ -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\".*"
index 17f233a099cebb20f5206295a753d717aeeddb8a..311daaca87cc6fa8be318ffb78a3f766ed463b3e 100644 (file)
@@ -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
     }
index 9f2d04e2a513ee090c68a32e6690a8ded178182a..d54e3ecf43340b6c8801e657dbfb428a92019a2e 100644 (file)
@@ -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"
 
index a33d31103f7392decf5d9600df2ffac237919316..bbd5e651b7f7b49ead8625b7269062c36c0435b5 100644 (file)
@@ -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,.*"
index 7c50aebd5455b526d6a5a8a38508fb9fecd0cac3..3f3da91947afe3d40e24ea96d3592dd3b84df648 100644 (file)
@@ -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 ""
index e3a5b3df7d44bb427e31ca1f016b7137df6b48f5..037e8288b62f09e3c066a67518e7b6f26a6ed6cd 100644 (file)
@@ -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" {
index a2fde0b030564d5935773ceb8628c177e9a3ffff..73b61056a192bba222248aa28ac202dfda03f657 100644 (file)
@@ -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
index 95aba7b3b17762341f0c71bddff653c9f4f3fb3b..e59f22b2454557ad3d4b35f3c059daa607673017 100644 (file)
@@ -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
     }
index 0b2c8cfe61734bc801960bb5cabec0cf4aa05afa..2ddfd210f0ffd65aff395dbd875c6138f3260f84 100644 (file)
@@ -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" \
index 87d64e8f9f0c1d4fc2849620884d3be24602871f..2b34c0a2378419a548b3afba4d62069a5f397d17 100644 (file)
@@ -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.*"
     }
 }
 
index 55416d7137642f6eea575e72d30236487312f383..57aac880333a37add095702cd5a6b57c0f8ceed6 100644 (file)
@@ -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"
            }
        }
index cfdfbe15ee5812770cdbdd3e96b94f839a2ecfbf..3742c4d25f308ffed002061b58b59e89d35fe7cc 100644 (file)
@@ -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"
 }
 
index 4f8449c7d96b493e177e9e20e10d9402529a4280..39b71b358775c2b5b6b1765395993f2ab02e6004 100644 (file)
@@ -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.*"
index 8e00334af852ff75df52c7d16e119133a6eb88ba..5d4309f37501f016ad224e9d8886f2ef18151ad8 100644 (file)
@@ -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
index 0a66da6d54366f865d1ec799cbe2c8d8f0f5822e..a4c90de7031b98e5c6d312d36e54bb54eb98f67f 100644 (file)
@@ -3504,7 +3504,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
        }
@@ -9537,7 +9537,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" } {