From: Andrew Burgess Date: Mon, 13 Oct 2025 13:44:56 +0000 (+0100) Subject: gdb/testsuite: remove incorrect global variable accesses X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b6753354fbbe7c2c66ae9f452ba7aa049db0fe0c;p=thirdparty%2Fbinutils-gdb.git gdb/testsuite: remove incorrect global variable accesses I noticed in gdb.replay/missing-thread.exp a reference to $testfile in a location where 'testfile' had not been made available via a use of 'global'. The uses looked like this: unsupported "$testfile (couldn't start gdbreplay)" I think there are three problems here, the $testfile is invalid because there's no 'global testfile' making the variable available. The use of $testfile is redundant anyway as 'unsupported' already adds the script name to the output line. The final text within parenthesis is bad style that's an important part of the output, but GDB test name style is that text in parenthesis is additional text that could be ignored, e.g. "(timeout)". Replace the above with just: unsupported "couldn't start gdbreplay" This same construct has been copied into multiple gdb.replay/ tests, so fix them all. There's no change to what is actually tested after this commit. --- diff --git a/gdb/testsuite/gdb.replay/connect.exp b/gdb/testsuite/gdb.replay/connect.exp index f52f209e225..103f53abd6b 100644 --- a/gdb/testsuite/gdb.replay/connect.exp +++ b/gdb/testsuite/gdb.replay/connect.exp @@ -58,7 +58,7 @@ proc_with_prefix record_initial_logfile {} { # Connect to gdbserver. if {![gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport] == 0} { - unsupported "$testfile (couldn't start gdbserver)" + unsupported "couldn't start gdbserver" return } @@ -84,7 +84,7 @@ proc_with_prefix replay_without_error {} { # Connect to gdbreplay. if {![gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport] == 0} { - unsupported "$testfile (couldn't start gdbreplay)" + unsupported "couldn't start gdbreplay" return } gdb_breakpoint main diff --git a/gdb/testsuite/gdb.replay/fetch-exec-and-args.exp b/gdb/testsuite/gdb.replay/fetch-exec-and-args.exp index c4fcba73a83..c9d03c91622 100644 --- a/gdb/testsuite/gdb.replay/fetch-exec-and-args.exp +++ b/gdb/testsuite/gdb.replay/fetch-exec-and-args.exp @@ -54,7 +54,7 @@ proc_with_prefix record_initial_logfile { remotelog } { # Connect to gdbserver. if {[gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport] != 0} { - unsupported "$testfile (couldn't connect to gdbserver)" + unsupported "couldn't connect to gdbserver" return } diff --git a/gdb/testsuite/gdb.replay/missing-thread.exp b/gdb/testsuite/gdb.replay/missing-thread.exp index 6ee2e4cff14..0c9efa2f98b 100644 --- a/gdb/testsuite/gdb.replay/missing-thread.exp +++ b/gdb/testsuite/gdb.replay/missing-thread.exp @@ -63,7 +63,7 @@ proc_with_prefix record_initial_logfile { log_filename } { # Connect to gdbserver. if {![gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport] == 0} { - unsupported "$testfile (couldn't start gdbserver)" + unsupported "couldn't start gdbserver" return }