[binutils-gdb] [gdb/testsuite] Fix gdb.dap/corefile.exp with Tcl 9.0

Tom de Vries via Gdb-cvs <[email protected]>
Newsgroups gmane.comp.gdb.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a8f34ab5485c9a16e7c8853eeacaca5dfb946461

commit a8f34ab5485c9a16e7c8853eeacaca5dfb946461
Author: Tom de Vries <[email protected]>
Date:   Mon May 11 11:50:13 2026 +0200

    [gdb/testsuite] Fix gdb.dap/corefile.exp with Tcl 9.0
    
    With test-case gdb.dap/corefile.exp and Tcl 9.0 I run into:
    ...
    ERROR: tcl error sourcing gdb/testsuite/gdb.dap/corefile.exp.
    ERROR: tcl error code TCL LOOKUP VARNAME reg_name
    ERROR: can't read "reg_name": no such variable
        while executing
    "s \$$reg_name"
        (in namespace eval "::ton::2json" script line 1)
        invoked from within
    "namespace eval ton::2json $obj"
    ...
    
    Fix this by making clear that reg_name is a variable in the global namespace.
    
    Likewise for variable new_value.
    
    Tested on aarch64-linux.

Diff:
---
 gdb/testsuite/gdb.dap/corefile.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.dap/corefile.exp b/gdb/testsuite/gdb.dap/corefile.exp
index 088cc82d4c8..256edcfb6fe 100644
--- a/gdb/testsuite/gdb.dap/corefile.exp
+++ b/gdb/testsuite/gdb.dap/corefile.exp
@@ -97,7 +97,7 @@ set expected_exception_count 1
 if {[string is integer -strict $reg_value]} {
     set new_value [expr {$reg_value + 1}]
     set obj [dap_request_and_response setExpression \
-		 {o expression [s \$$reg_name] value [s $new_value]}]
+		 {o expression [s \$$::reg_name] value [s $::new_value]}]
     set response [lindex $obj 0]
     gdb_assert { [dict get $response success] == "false" } \
 	"set register fails"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.