]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/testsuite: remove incorrect global variable accesses
authorAndrew Burgess <aburgess@redhat.com>
Mon, 13 Oct 2025 13:44:56 +0000 (14:44 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Wed, 15 Oct 2025 19:15:18 +0000 (20:15 +0100)
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.

gdb/testsuite/gdb.replay/connect.exp
gdb/testsuite/gdb.replay/fetch-exec-and-args.exp
gdb/testsuite/gdb.replay/missing-thread.exp

index f52f209e225b9baa9b2af0de7c9252f268bc6548..103f53abd6b597b46de3c1e2940ce5e39740acd4 100644 (file)
@@ -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
index c4fcba73a833395ee44df3d0da25cfdb0ed839d7..c9d03c916223a1e0c00e29be724b5832342393ca 100644 (file)
@@ -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
     }
 
index 6ee2e4cff14e259715be106de6042126f7b0fa1c..0c9efa2f98b86185ebb2360c26a52748d04df787 100644 (file)
@@ -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
     }