From: Tom de Vries Date: Sat, 1 Aug 2026 13:26:19 +0000 (+0200) Subject: [gdb/testsuite] Drop global decls at global level X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=99e6cde739b4e8413c92d657edca86f3df07f841;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite] Drop global decls at global level While reviewing a patch I came across: ... global srcdir ... This is only required in a proc, so this is superfluous. Delete similar cases using: ... $ find gdb/testsuite/gdb.* -name *.exp | xargs sed -i '/^global /d' ... Tested on x86_64-linux. Approved-By: Luis Machado --- diff --git a/gdb/testsuite/gdb.arch/aarch64-mte.exp b/gdb/testsuite/gdb.arch/aarch64-mte.exp index 72d4bba7253..17ec0866f36 100644 --- a/gdb/testsuite/gdb.arch/aarch64-mte.exp +++ b/gdb/testsuite/gdb.arch/aarch64-mte.exp @@ -15,8 +15,6 @@ # Test a binary that uses MTE and exercise various MTE-related scenarios. -global hex -global decimal # Return TAG in hex format with no leading zeroes. proc get_hex_tag { tag } { diff --git a/gdb/testsuite/gdb.base/checkpoint.exp b/gdb/testsuite/gdb.base/checkpoint.exp index 828a633d4a4..23686f8fcf0 100644 --- a/gdb/testsuite/gdb.base/checkpoint.exp +++ b/gdb/testsuite/gdb.base/checkpoint.exp @@ -41,7 +41,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile \ return } -global gdb_prompt # # This tests gdb checkpoint and restart. diff --git a/gdb/testsuite/gdb.base/ctxobj.exp b/gdb/testsuite/gdb.base/ctxobj.exp index 3b1b12a9b18..e03d6fc2b5c 100644 --- a/gdb/testsuite/gdb.base/ctxobj.exp +++ b/gdb/testsuite/gdb.base/ctxobj.exp @@ -65,7 +65,6 @@ gdb_test "break ctxobj-f.c:$bp_location" \ "Breakpoint ${::decimal} at ${::hex}: .*" \ "break in get_version functions" -global expect_out set test "continue to get_version_1" gdb_test_multiple "continue" $test { -re "Breakpoint ($bkptno_num_re), get_version_1 \\(\\).*\r\n.*$gdb_prompt $" { diff --git a/gdb/testsuite/gdb.base/detach.exp b/gdb/testsuite/gdb.base/detach.exp index b8b1ce91dde..bd19cb166a5 100644 --- a/gdb/testsuite/gdb.base/detach.exp +++ b/gdb/testsuite/gdb.base/detach.exp @@ -41,7 +41,6 @@ proc do_detach_tests {} { gdb_test "detach" "Detaching from program: .*$escapedbinfile, .*" "detach, $pass" } -global pass set pass "one" do_detach_tests diff --git a/gdb/testsuite/gdb.base/miscexprs.exp b/gdb/testsuite/gdb.base/miscexprs.exp index fb921dccfe1..3190a18a799 100644 --- a/gdb/testsuite/gdb.base/miscexprs.exp +++ b/gdb/testsuite/gdb.base/miscexprs.exp @@ -62,7 +62,6 @@ gdb_test "cont" \ gdb_test "up" " main .*" "up from marker1" -global hex gdb_test "print &ibig.i\[0\]" " = \\(int \\*\\) $hex" diff --git a/gdb/testsuite/gdb.base/pie-execl.exp b/gdb/testsuite/gdb.base/pie-execl.exp index cd4951f1be2..4bfd3078248 100644 --- a/gdb/testsuite/gdb.base/pie-execl.exp +++ b/gdb/testsuite/gdb.base/pie-execl.exp @@ -16,8 +16,6 @@ # The problem was due to amd64_skip_prologue attempting to access inferior # memory before the PIE (Position Independent Executable) gets relocated. -global inferior_spawn_id -global gdb_spawn_id require {istarget *-linux*} require {!target_info exists noargs} diff --git a/gdb/testsuite/gdb.base/wchar.exp b/gdb/testsuite/gdb.base/wchar.exp index d4c1a5fd87c..b02f4a78336 100644 --- a/gdb/testsuite/gdb.base/wchar.exp +++ b/gdb/testsuite/gdb.base/wchar.exp @@ -53,7 +53,6 @@ gdb_test_multiple $test $test { gdb_test "print repeat" "= L\"A\", '$cent' , \"B.*" -global hex gdb_test "print repeat_p" \ "= $hex L\"A\", '$cent' , \"B\"" diff --git a/gdb/testsuite/gdb.base/write_mem.exp b/gdb/testsuite/gdb.base/write_mem.exp index 2c9509dd658..f5d86e7e427 100644 --- a/gdb/testsuite/gdb.base/write_mem.exp +++ b/gdb/testsuite/gdb.base/write_mem.exp @@ -18,7 +18,6 @@ # Test for PR gdb/20948 # Verify that invoking gdb with the --write argument works as expected -global GDBFLAGS standard_testfile if {[build_executable $testfile.exp $testfile \ diff --git a/gdb/testsuite/gdb.btrace/stepi.exp b/gdb/testsuite/gdb.btrace/stepi.exp index 41d465e2e66..86035f9cdc5 100644 --- a/gdb/testsuite/gdb.btrace/stepi.exp +++ b/gdb/testsuite/gdb.btrace/stepi.exp @@ -49,7 +49,6 @@ if {![runto_main]} { return -1 } -global gdb_prompt proc check_replay_at { insn } { gdb_test "info record" [multi_line \ diff --git a/gdb/testsuite/gdb.cp/converts.exp b/gdb/testsuite/gdb.cp/converts.exp index 60a732f87ee..54bdec425ad 100644 --- a/gdb/testsuite/gdb.cp/converts.exp +++ b/gdb/testsuite/gdb.cp/converts.exp @@ -56,7 +56,6 @@ gdb_test "p foo3_1 ((char *) 0, ta)" "Cannot resolve.*" \ "check all parameters for badness" # Tests for null pointer conversion -global gdb_prompt set nl {[\r\n]+} set t "null pointer conversion" gdb_test_multiple "p foo3_1 (0, 0)" $t { diff --git a/gdb/testsuite/gdb.cp/ovldbreak.exp b/gdb/testsuite/gdb.cp/ovldbreak.exp index dce7d3b414b..8179a10c71e 100644 --- a/gdb/testsuite/gdb.cp/ovldbreak.exp +++ b/gdb/testsuite/gdb.cp/ovldbreak.exp @@ -22,7 +22,6 @@ # overloaded member functions # -global timeout set timeout 15 # # test running programs diff --git a/gdb/testsuite/gdb.disasm/am33.exp b/gdb/testsuite/gdb.disasm/am33.exp index 71bba6cef28..878b462754a 100644 --- a/gdb/testsuite/gdb.disasm/am33.exp +++ b/gdb/testsuite/gdb.disasm/am33.exp @@ -18,7 +18,6 @@ require {istarget "mn10300*-*-*"} -global exec_output set testfile "am33" set srcfile ${srcdir}/${subdir}/${testfile}.s diff --git a/gdb/testsuite/gdb.disasm/mn10300.exp b/gdb/testsuite/gdb.disasm/mn10300.exp index 7fb6b0ecaea..699905ec3b1 100644 --- a/gdb/testsuite/gdb.disasm/mn10300.exp +++ b/gdb/testsuite/gdb.disasm/mn10300.exp @@ -18,7 +18,6 @@ require {istarget "mn10300*-*-*"} -global exec_output set testfile "mn10300" set srcfile ${srcdir}/${subdir}/${testfile}.s diff --git a/gdb/testsuite/gdb.disasm/t13_otr.exp b/gdb/testsuite/gdb.disasm/t13_otr.exp index 57e9179c05a..8ee990ed074 100644 --- a/gdb/testsuite/gdb.disasm/t13_otr.exp +++ b/gdb/testsuite/gdb.disasm/t13_otr.exp @@ -41,7 +41,6 @@ gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load $binfile -global hex gdb_test "x /i start" "bra\t.\\+18 \\($hex\\)" \ "bra .+18" diff --git a/gdb/testsuite/gdb.perf/disassemble.exp b/gdb/testsuite/gdb.perf/disassemble.exp index 89037e9c377..c9da08cab44 100644 --- a/gdb/testsuite/gdb.perf/disassemble.exp +++ b/gdb/testsuite/gdb.perf/disassemble.exp @@ -19,7 +19,6 @@ load_lib perftest.exp require allow_perf_tests -global GDB standard_testfile .c # Overwrite $binfile diff --git a/gdb/testsuite/gdb.python/py-block.exp b/gdb/testsuite/gdb.python/py-block.exp index 30983ac35f2..6ea77348279 100644 --- a/gdb/testsuite/gdb.python/py-block.exp +++ b/gdb/testsuite/gdb.python/py-block.exp @@ -30,7 +30,6 @@ if {![runto_main]} { return } -global hex decimal gdb_breakpoint [gdb_get_line_number "Block break here."] gdb_continue_to_breakpoint "Block break here." diff --git a/gdb/testsuite/gdb.python/py-symbol.exp b/gdb/testsuite/gdb.python/py-symbol.exp index 9d36b14567a..4988a8bb3f2 100644 --- a/gdb/testsuite/gdb.python/py-symbol.exp +++ b/gdb/testsuite/gdb.python/py-symbol.exp @@ -93,7 +93,6 @@ if {![runto_main]} { return } -global hex decimal gdb_breakpoint [gdb_get_line_number "Block break here."] gdb_continue_to_breakpoint "Block break here." diff --git a/gdb/testsuite/gdb.python/py-symtab.exp b/gdb/testsuite/gdb.python/py-symtab.exp index b5dd0c26988..5c6e13d4e75 100644 --- a/gdb/testsuite/gdb.python/py-symtab.exp +++ b/gdb/testsuite/gdb.python/py-symtab.exp @@ -32,7 +32,6 @@ if {![runto_main]} { set debug_types [debug_types] -global hex decimal # Setup and get the symbol table. set line_no [gdb_get_line_number "Block break here."] diff --git a/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp b/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp index 4fe64a775d8..5d65245db39 100644 --- a/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp +++ b/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp @@ -143,8 +143,6 @@ proc record_full_function {function} { runto_main -global hex -global decimal # Record all the execution for vmov tests first. diff --git a/gdb/testsuite/gdb.reverse/i386-precsave.exp b/gdb/testsuite/gdb.reverse/i386-precsave.exp index 4bde399bc45..8f6ad2283c0 100644 --- a/gdb/testsuite/gdb.reverse/i386-precsave.exp +++ b/gdb/testsuite/gdb.reverse/i386-precsave.exp @@ -41,8 +41,6 @@ runto_main # Activate process record/replay gdb_test_no_output "record" "turn on process record" -global hex -global decimal gdb_test "break $end_of_main" \ "Breakpoint $decimal at .*$srcfile, line $end_of_main\." \ diff --git a/gdb/testsuite/gdb.reverse/i386-reverse.exp b/gdb/testsuite/gdb.reverse/i386-reverse.exp index 2013a969f8c..fe404b2c5e2 100644 --- a/gdb/testsuite/gdb.reverse/i386-reverse.exp +++ b/gdb/testsuite/gdb.reverse/i386-reverse.exp @@ -41,8 +41,6 @@ if {[supports_process_record]} { gdb_test_no_output "record" "turn on process record" } -global hex -global decimal gdb_test "step" "inc .eax.*" "step to inc eax 1st time" send_gdb "info reg eax\n" diff --git a/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp b/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp index 3ed1d7e6fae..7d250b47cf0 100644 --- a/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp +++ b/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp @@ -48,8 +48,6 @@ if {[supports_process_record]} { gdb_test_no_output "record" "turn on process record" } -global hex -global decimal #sse_test diff --git a/gdb/testsuite/gdb.server/unittest.exp b/gdb/testsuite/gdb.server/unittest.exp index 58116b0a25c..1a9e93a98ef 100644 --- a/gdb/testsuite/gdb.server/unittest.exp +++ b/gdb/testsuite/gdb.server/unittest.exp @@ -21,7 +21,6 @@ standard_testfile require allow_gdbserver_tests -global server_spawn_id set gdbserver [find_gdbserver] set gdbserver_command "$gdbserver --selftest" diff --git a/gdb/testsuite/gdb.threads/pthread_cond_wait.exp b/gdb/testsuite/gdb.threads/pthread_cond_wait.exp index ae700b8715c..d1440820f95 100644 --- a/gdb/testsuite/gdb.threads/pthread_cond_wait.exp +++ b/gdb/testsuite/gdb.threads/pthread_cond_wait.exp @@ -45,8 +45,6 @@ gdb_test "continue" \ # occur in a single thread's backtrace, in the given order. # -global hex -global decimal # # This is a "backtrace break" ("btb"): diff --git a/gdb/testsuite/gdb.threads/schedlock.exp b/gdb/testsuite/gdb.threads/schedlock.exp index 61a9d5ddef5..572e1f9a715 100644 --- a/gdb/testsuite/gdb.threads/schedlock.exp +++ b/gdb/testsuite/gdb.threads/schedlock.exp @@ -157,7 +157,6 @@ gdb_test_no_output "set width 0" runto_main # See if scheduler locking is available on this target. -global gdb_prompt gdb_test_multiple "set scheduler-locking off" "scheduler locking set to none" { -re "Target .* cannot support this command" { unsupported "target does not support scheduler locking"