Hi Tom,
Thanks much for this series. It's a nice improvement.
I have a comment below.
On 2023-01-12 3:00 a.m., Tom Tromey wrote:
> The previous transforms left some files with multiple calls to
> "require" near the top. This patch consolidates these to the extent
> possible. (There are a couple of files that call "require" later,
> after running some tests. These have been left alone.)
>
> diff --git a/gdb/testsuite/gdb.ada/catch_ex_std.exp b/gdb/testsuite/gdb.ada/catch_ex_std.exp
> index 73cbdaf90ca..c7b65098208 100644
> --- a/gdb/testsuite/gdb.ada/catch_ex_std.exp
> +++ b/gdb/testsuite/gdb.ada/catch_ex_std.exp
> @@ -13,12 +13,10 @@
> # You should have received a copy of the GNU General Public License
> # along with this program. If not, see <http://www.gnu.org/licenses/>.
>
> -require allow_shlib_tests
> +require allow_shlib_tests allow_ada_tests
>
> load_lib "ada.exp"
>
> -require allow_ada_tests
> -
> standard_ada_testfile foo
>
> set srcfile2 [file join [file dirname $srcfile] some_package.adb]
> diff --git a/gdb/testsuite/gdb.ada/dynamic-iface.exp b/gdb/testsuite/gdb.ada/dynamic-iface.exp
> index 431fa29d64f..b523968194a 100644
> --- a/gdb/testsuite/gdb.ada/dynamic-iface.exp
> +++ b/gdb/testsuite/gdb.ada/dynamic-iface.exp
> @@ -15,9 +15,7 @@
>
> load_lib "ada.exp"
>
> -require allow_ada_tests
> -
> -require gnat_runtime_has_debug_info
> +require allow_ada_tests gnat_runtime_has_debug_info
>
> standard_ada_testfile main
>
> diff --git a/gdb/testsuite/gdb.ada/exec_changed.exp b/gdb/testsuite/gdb.ada/exec_changed.exp
> index 9e69d136e31..087d1ac9b3d 100644
> --- a/gdb/testsuite/gdb.ada/exec_changed.exp
> +++ b/gdb/testsuite/gdb.ada/exec_changed.exp
> @@ -15,11 +15,9 @@
>
> load_lib "ada.exp"
>
> -require allow_ada_tests
> -
> # This testcase verifies the behavior of the `start' command, which
> # does not work when we use the gdb stub...
> -require !use_gdb_stub
> +require allow_ada_tests !use_gdb_stub
>
> standard_ada_testfile first
> --- a/gdb/testsuite/gdb.ada/start.exp
> +++ b/gdb/testsuite/gdb.ada/start.exp
> @@ -15,11 +15,9 @@
>
> load_lib "ada.exp"
>
> -require allow_ada_tests
> -
> # This testcase verifies the behavior of the `start' command, which
> # does not work when we use the gdb stub...
> -require !use_gdb_stub
> +require allow_ada_tests !use_gdb_stub
>
...
> standard_ada_testfile dummy
>
> diff --git a/gdb/testsuite/gdb.ada/tagged.exp b/gdb/testsuite/gdb.ada/tagged.exp
> index f45a6509da5..a842ed2b6ba 100644
> index fb56d2602b1..970f44da21c 100644
> --- a/gdb/testsuite/gdb.base/async-shell.exp
> +++ b/gdb/testsuite/gdb.base/async-shell.exp
> @@ -15,10 +15,8 @@
>
> standard_testfile
>
> -require support_displaced_stepping
> -
> # The testfile uses "run". The real bug happened only for ![is_remote target].
> -require !use_gdb_stub
> +require support_displaced_stepping !use_gdb_stub
I'm not really sure consolidation when we have a comment describing each "require" line
before is an improvement. For example, above, it was clear before that the use_gdb_stub
requirement was related to "run". Afterwards, it is not clear whether the
support_displaced_stepping check is related to the comment.
>
> --- a/gdb/testsuite/gdb.base/fork-print-inferior-events.exp
> +++ b/gdb/testsuite/gdb.base/fork-print-inferior-events.exp
> @@ -20,11 +20,9 @@
> # 'set detach-on-fork [on,off]' are the correct ones.
>
> # This test relies on "run", so it cannot run on target remote stubs.
> -require !use_gdb_stub
> -
> # Test relies on checking follow-fork output. Do not run if gdb debug is
> # enabled as it will be redirected to the log.
> -require !gdb_debug_enabled
> +require !use_gdb_stub !gdb_debug_enabled
>
Here similarly. Having a require line connected to the comment as before
seemed better to me, as it's more localized, it's obvious to which require
expression the comment is refering to. If we always merge, then I fear that
connection will be lost in some less obvious cases.
> diff --git a/gdb/testsuite/gdb.base/solib-display.exp b/gdb/testsuite/gdb.base/solib-display.exp
> index aaaa134007b..913203ecfb9 100644
> --- a/gdb/testsuite/gdb.base/solib-display.exp
> +++ b/gdb/testsuite/gdb.base/solib-display.exp
> @@ -28,8 +28,6 @@
> # (and thus aren't affected by shared library unloading) are not
> # disabled prematurely.
>
> -require allow_shlib_tests
> -
> # This test is currently not supported for stub targets, because it uses the
> # start command (through gdb_start_cmd). In theory, it could be changed to
> # use something else (kill + gdb_run_cmd with a manual breakpoint at main).
> @@ -43,7 +41,7 @@ require allow_shlib_tests
> # This is because the initial stop is done before the shared libraries are
> # loaded.
>
> -require !use_gdb_stub
> +require allow_shlib_tests !use_gdb_stub
>
Here too. Etc.
> # Library file.
> set libname "solib-display-lib"
> diff --git a/gdb/testsuite/gdb.base/solib-nodir.exp b/gdb/testsuite/gdb.base/solib-nodir.exp
> index dd0724909ad..f5d94798f9d 100644
> --- a/gdb/testsuite/gdb.base/solib-nodir.exp
> +++ b/gdb/testsuite/gdb.base/solib-nodir.exp
> @@ -13,18 +13,16 @@
> # You should have received a copy of the GNU General Public License
> # along with this program. If not, see <http://www.gnu.org/licenses/>. */
>
> -require allow_shlib_tests
> +# We need to be able to influence the target's environment and working
> +# directory. Can't do that if when we connect the inferior is already
> +# running.
> +require allow_shlib_tests !use_gdb_stub
>
> # The testcase assumes the target can access the OBJDIR.
> if [is_remote target] {
> return
> }
>
> -# We need to be able to influence the target's environment and working
> -# directory. Can't do that if when we connect the inferior is already
> -# running.
> -require !use_gdb_stub
Ditto. The connection between "already running" and use_gdb_stub ends up
diluted.
Same for the rest of patch where we have comments for each require.
@@ -13,12 +13,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-require allow_shlib_tests
+require allow_shlib_tests allow_ada_tests
load_lib "ada.exp"
-require allow_ada_tests
-
standard_ada_testfile foo
set srcfile2 [file join [file dirname $srcfile] some_package.adb]
@@ -15,9 +15,7 @@
load_lib "ada.exp"
-require allow_ada_tests
-
-require gnat_runtime_has_debug_info
+require allow_ada_tests gnat_runtime_has_debug_info
standard_ada_testfile main
@@ -15,11 +15,9 @@
load_lib "ada.exp"
-require allow_ada_tests
-
# This testcase verifies the behavior of the `start' command, which
# does not work when we use the gdb stub...
-require !use_gdb_stub
+require allow_ada_tests !use_gdb_stub
standard_ada_testfile first
@@ -15,9 +15,7 @@
load_lib "ada.exp"
-require allow_ada_tests
-
-require gnat_runtime_has_debug_info
+require allow_ada_tests gnat_runtime_has_debug_info
standard_ada_testfile foo
@@ -15,9 +15,7 @@
load_lib "ada.exp"
-require allow_ada_tests
-
-require gnat_runtime_has_debug_info
+require allow_ada_tests gnat_runtime_has_debug_info
standard_ada_testfile p
@@ -15,9 +15,7 @@
load_lib "ada.exp"
-require allow_ada_tests
-
-require gnat_runtime_has_debug_info
+require allow_ada_tests gnat_runtime_has_debug_info
standard_ada_testfile foo
@@ -15,11 +15,9 @@
load_lib "ada.exp"
-require allow_ada_tests
-
# This testcase verifies the behavior of the `start' command, which
# does not work when we use the gdb stub...
-require !use_gdb_stub
+require allow_ada_tests !use_gdb_stub
standard_ada_testfile dummy
@@ -15,9 +15,7 @@
load_lib "ada.exp"
-require allow_ada_tests
-
-require gnat_runtime_has_debug_info
+require allow_ada_tests gnat_runtime_has_debug_info
standard_ada_testfile foo
@@ -15,9 +15,7 @@
load_lib "ada.exp"
-require allow_ada_tests
-
-require gnat_runtime_has_debug_info
+require allow_ada_tests gnat_runtime_has_debug_info
standard_ada_testfile p
@@ -17,9 +17,7 @@
load_lib "ada.exp"
-require allow_ada_tests
-
-require allow_hw_watchpoint_tests
+require allow_ada_tests allow_hw_watchpoint_tests
standard_ada_testfile foo
@@ -15,10 +15,8 @@
standard_testfile
-require support_displaced_stepping
-
# The testfile uses "run". The real bug happened only for ![is_remote target].
-require !use_gdb_stub
+require support_displaced_stepping !use_gdb_stub
save_vars { GDBFLAGS } {
set GDBFLAGS "$GDBFLAGS -ex \"set non-stop on\""
@@ -20,11 +20,9 @@
# 'set detach-on-fork [on,off]' are the correct ones.
# This test relies on "run", so it cannot run on target remote stubs.
-require !use_gdb_stub
-
# Test relies on checking follow-fork output. Do not run if gdb debug is
# enabled as it will be redirected to the log.
-require !gdb_debug_enabled
+require !use_gdb_stub !gdb_debug_enabled
standard_testfile
@@ -28,8 +28,6 @@
# (and thus aren't affected by shared library unloading) are not
# disabled prematurely.
-require allow_shlib_tests
-
# This test is currently not supported for stub targets, because it uses the
# start command (through gdb_start_cmd). In theory, it could be changed to
# use something else (kill + gdb_run_cmd with a manual breakpoint at main).
@@ -43,7 +41,7 @@ require allow_shlib_tests
# This is because the initial stop is done before the shared libraries are
# loaded.
-require !use_gdb_stub
+require allow_shlib_tests !use_gdb_stub
# Library file.
set libname "solib-display-lib"
@@ -13,18 +13,16 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. */
-require allow_shlib_tests
+# We need to be able to influence the target's environment and working
+# directory. Can't do that if when we connect the inferior is already
+# running.
+require allow_shlib_tests !use_gdb_stub
# The testcase assumes the target can access the OBJDIR.
if [is_remote target] {
return
}
-# We need to be able to influence the target's environment and working
-# directory. Can't do that if when we connect the inferior is already
-# running.
-require !use_gdb_stub
-
set testfile "solib-nodir"
# Arbitrary file, possibly not containing main, even an empty one.
set srclibfile foo.c
@@ -29,9 +29,7 @@
# 13) Check that the execution can continue without error.
# 14) Regression test for a stale breakpoints bug.
-require is_elf_target
-
-require allow_shlib_tests
+require is_elf_target allow_shlib_tests
set target_size TARGET_UNKNOWN
if {[is_lp64_target]} {
@@ -16,9 +16,7 @@
# watchpoint-hw-attach.exp -- Test if hardware watchpoints are used
# when attaching to a target.
-require allow_hw_watchpoint_tests
-
-require can_spawn_for_attach
+require allow_hw_watchpoint_tests can_spawn_for_attach
standard_testfile
@@ -13,9 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-require !use_gdb_stub
-
-require allow_hw_watchpoint_tests
+require !use_gdb_stub allow_hw_watchpoint_tests
standard_testfile
@@ -22,9 +22,7 @@
#
# Each inferior can be recorded separately.
-require allow_btrace_tests
-
-require !use_gdb_stub
+require allow_btrace_tests !use_gdb_stub
standard_testfile
if [prepare_for_testing "failed to prepare" $testfile {} {debug}] {
@@ -19,8 +19,7 @@
load_lib gdbserver-support.exp
-require allow_btrace_tests
-require allow_gdbserver_tests
+require allow_btrace_tests allow_gdbserver_tests
standard_testfile
if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
@@ -20,7 +20,10 @@
# test running programs
#
-require allow_cplus_tests
+# This testcase cannot use runto_main because of the different prompt
+# we get when using annotation level 2.
+#
+require allow_cplus_tests target_can_use_run_cmd
standard_testfile .cc
@@ -29,11 +32,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
return -1
}
-# This testcase cannot use runto_main because of the different prompt
-# we get when using annotation level 2.
-#
-require target_can_use_run_cmd
-
set breakpoints_invalid "\r\n\032\032breakpoints-invalid\r\n"
set frames_invalid "\r\n\032\032frames-invalid\r\n"
@@ -20,7 +20,10 @@
# test running programs
#
-require allow_cplus_tests
+# This testcase cannot use runto_main because of the different prompt
+# we get when using annotation level 2.
+#
+require allow_cplus_tests target_can_use_run_cmd
standard_testfile .cc
@@ -29,11 +32,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
return -1
}
-# This testcase cannot use runto_main because of the different prompt
-# we get when using annotation level 2.
-#
-require target_can_use_run_cmd
-
#
# line number where we need to stop in main
#
@@ -16,9 +16,7 @@
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
-require allow_cplus_tests
+require dwarf2_support allow_cplus_tests
standard_testfile .S
@@ -16,15 +16,14 @@
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
+# It requires fortran.
+require dwarf2_support allow_fortran_tests
# This test can only be run on x86-64 targets.
if {![istarget x86_64-*] || ![is_lp64_target]} {
return 0
}
-# It requires fortran.
-require allow_fortran_tests
standard_testfile .S
@@ -16,12 +16,11 @@
# Check that GDB can call C++ functions whose parameters or return values have
# type containing a static member of the same type.
-# Still no C++ compiler is used.
-require allow_cplus_tests
-
load_lib dwarf.exp
+
+# Still no C++ compiler is used.
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
+require allow_cplus_tests dwarf2_support
standard_testfile .S -main.c
@@ -25,10 +25,8 @@
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
# The .c files use __attribute__.
-require is_c_compiler_gcc
+require dwarf2_support is_c_compiler_gcc
# Reuse many of the test source files from dw2-inline-header-1.exp.
standard_testfile dw2-inline-header-lbls.c dw2-inline-header.S \
@@ -53,10 +53,8 @@
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
# The .c files use __attribute__.
-require is_c_compiler_gcc
+require dwarf2_support is_c_compiler_gcc
# Prepare and run the test.
proc do_test { start_label func_name tag } {
@@ -48,10 +48,8 @@
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
# The .c files use __attribute__.
-require is_c_compiler_gcc
+require dwarf2_support is_c_compiler_gcc
standard_testfile dw2-inline-header-lbls.c dw2-inline-header.S \
dw2-inline-header.c dw2-inline-header.h
@@ -37,10 +37,8 @@
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
# The .c files use __attribute__.
-require is_c_compiler_gcc
+require dwarf2_support is_c_compiler_gcc
standard_testfile dw2-inline-header-lbls.c dw2-inline-header.S \
dw2-inline-header.c dw2-inline-header.h
@@ -26,10 +26,8 @@
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
# The .c files use __attribute__.
-require is_c_compiler_gcc
+require dwarf2_support is_c_compiler_gcc
standard_testfile .c .S
@@ -27,10 +27,8 @@
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
# The .c files use __attribute__.
-require is_c_compiler_gcc
+require dwarf2_support is_c_compiler_gcc
standard_testfile -lbls.c .S \
.c .h
@@ -26,10 +26,8 @@
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
# The .c files use __attribute__.
-require is_c_compiler_gcc
+require dwarf2_support is_c_compiler_gcc
standard_testfile .c .S
@@ -26,10 +26,8 @@
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
# The .c files use __attribute__.
-require is_c_compiler_gcc
+require dwarf2_support is_c_compiler_gcc
standard_testfile .c .S
@@ -26,10 +26,8 @@
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
# The .c files use __attribute__.
-require is_c_compiler_gcc
+require dwarf2_support is_c_compiler_gcc
standard_testfile .c .S
@@ -15,10 +15,8 @@
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
# The .c files use __attribute__.
-require is_c_compiler_gcc
+require dwarf2_support is_c_compiler_gcc
standard_testfile .c -dw.S
@@ -16,12 +16,11 @@
# Check that GDB can call C++ functions whose parameters or return values have
# type containing a static member of the same type.
-# Still no C++ compiler is used.
-require allow_cplus_tests
-
load_lib dwarf.exp
+
+# Still no C++ compiler is used.
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
+require allow_cplus_tests dwarf2_support
standard_testfile .S
set executable ${testfile}
@@ -19,10 +19,8 @@
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
# The .c files use __attribute__.
-require is_c_compiler_gcc
+require dwarf2_support is_c_compiler_gcc
standard_testfile main.c -dw.S
@@ -19,10 +19,8 @@
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
# The .c files use __attribute__.
-require is_c_compiler_gcc
+require dwarf2_support is_c_compiler_gcc
standard_testfile main.c -dw.S
@@ -18,10 +18,8 @@ load_lib dwarf.exp
# DW_AT_high_pc but with DW_AT_ranges instead.
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
# The .c files use __attribute__.
-require is_c_compiler_gcc
+require dwarf2_support is_c_compiler_gcc
standard_testfile .c -dw.S
@@ -17,9 +17,7 @@ load_lib dwarf.exp
# Test DW_AT_ranges in the context of a subprogram scope.
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
-require is_c_compiler_gcc
+require dwarf2_support is_c_compiler_gcc
proc do_test {suffix} {
global gdb_test_file_name
@@ -22,10 +22,8 @@ load_lib dwarf.exp
# instead.
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
# The .c files use __attribute__.
-require is_c_compiler_gcc
+require dwarf2_support is_c_compiler_gcc
standard_testfile .c -dw.S
@@ -18,9 +18,7 @@ load_lib dwarf.exp
# Test that psymbols are made when DW_AT_ranges is used.
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
-require is_c_compiler_gcc
+require dwarf2_support is_c_compiler_gcc
standard_testfile main.c .c -dw.S
@@ -18,10 +18,8 @@ load_lib dwarf.exp
# DW_AT_high_pc but with DW_AT_ranges instead.
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
# The .c files use __attribute__.
-require is_c_compiler_gcc
+require dwarf2_support is_c_compiler_gcc
standard_testfile .c -2.c -3.c
set asmfile [standard_output_file ${testfile}.s]
@@ -28,10 +28,8 @@
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
# The .c files use __attribute__.
-require is_c_compiler_gcc
+require dwarf2_support is_c_compiler_gcc
standard_testfile .c -dw.S
@@ -15,10 +15,8 @@
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
# The .c files use __attribute__.
-require is_c_compiler_gcc
+require dwarf2_support is_c_compiler_gcc
standard_testfile .c -dw.S
@@ -25,12 +25,10 @@
# Because of (1), the test has to be written in assembly with explicit CFI
# directives.
-# Check if starti command is supported.
-require !use_gdb_stub
-
load_lib dwarf.exp
-require dwarf2_support
+# Check if starti command is supported.
+require !use_gdb_stub dwarf2_support
standard_testfile .S
@@ -16,9 +16,7 @@
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
-require allow_cplus_tests
+require dwarf2_support allow_cplus_tests
standard_testfile main.c -dw.S
@@ -16,9 +16,7 @@
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
-require allow_cplus_tests
+require dwarf2_support allow_cplus_tests
standard_testfile main.c -dw.S
@@ -16,12 +16,10 @@
# Test a C++ reference marked with DW_OP_GNU_implicit_pointer.
# The referenced value is a global array whose location is a DW_OP_addr.
-require allow_cplus_tests
-
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
+require allow_cplus_tests dwarf2_support
# We'll place the output of Dwarf::assemble in implref-array.S.
standard_testfile .c .S
@@ -16,12 +16,10 @@
# Test a C++ reference marked with DW_OP_GNU_implicit_pointer.
# The referenced value is a DW_AT_const_value.
-require allow_cplus_tests
-
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
+require allow_cplus_tests dwarf2_support
# We'll place the output of Dwarf::assemble in implref-const.S.
standard_testfile main.c .S
@@ -16,12 +16,10 @@
# Test a C++ reference marked with DW_OP_GNU_implicit_pointer.
# The referenced value is a global variable whose location is a DW_OP_addr.
-require allow_cplus_tests
-
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
+require allow_cplus_tests dwarf2_support
# We'll place the output of Dwarf::assemble in implref-global.S.
standard_testfile .c .S
@@ -16,12 +16,10 @@
# Test a C++ reference marked with DW_OP_GNU_implicit_pointer.
# The referenced value is a global struct whose location is a DW_OP_addr.
-require allow_cplus_tests
-
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
+require allow_cplus_tests dwarf2_support
# We'll place the output of Dwarf::assemble in implref-struct.S.
standard_testfile .c .S
@@ -22,12 +22,10 @@
# on specific compiler versions or use of optimization switches, in
# this case -flto.
-require allow_cplus_tests
-
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
+require allow_cplus_tests dwarf2_support
standard_testfile .c .S
@@ -48,13 +48,11 @@
# Therefore, due to #2 above, this test case creates debug info
# which is then used by a shared object.
-# This test can't be run on targets lacking shared library support.
-require allow_shlib_tests
-
load_lib dwarf.exp
+# This test can't be run on targets lacking shared library support.
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
+require allow_shlib_tests dwarf2_support
# gdb_test_file_name is the name of this file without the .exp
# extension. Use it to form basenames for the main program
@@ -15,9 +15,7 @@
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-4 and use gas.
-require dwarf2_support
-
-require !use_gdb_stub
+require dwarf2_support !use_gdb_stub
standard_testfile .c -dw.S
@@ -15,9 +15,7 @@
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
-require allow_cplus_tests
+require dwarf2_support allow_cplus_tests
standard_testfile .S
@@ -15,9 +15,7 @@
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
-require allow_cplus_tests
+require dwarf2_support allow_cplus_tests
standard_testfile .cc -dw.S
@@ -15,9 +15,7 @@
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
-require allow_cplus_tests
+require dwarf2_support allow_cplus_tests
standard_testfile main.c -dw4.S
@@ -15,9 +15,7 @@
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
-require allow_cplus_tests
+require dwarf2_support allow_cplus_tests
standard_testfile main.c .S
@@ -15,9 +15,7 @@
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
-require allow_cplus_tests
+require dwarf2_support allow_cplus_tests
standard_testfile main.c -dw.S
@@ -15,9 +15,7 @@
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
-require allow_cplus_tests
+require dwarf2_support allow_cplus_tests
standard_testfile method-ptr.cc -dw.S
@@ -15,11 +15,9 @@
# Test "set debug expr 1" on Fortran expressions.
-require allow_fortran_tests
-
# Test relies on checking gdb debug output. Do not run if gdb debug is
# enabled as any debug will be redirected to the log.
-require !gdb_debug_enabled
+require allow_fortran_tests !gdb_debug_enabled
standard_testfile .f90
load_lib fortran.exp
@@ -21,7 +21,7 @@ set MIFLAGS "-i=mi"
standard_testfile
# Support for XML is needed to run this test.
-require allow_xml_test
+require allow_xml_test can_spawn_for_attach
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested "failed to compile"
@@ -32,8 +32,6 @@ if [mi_gdb_start] {
return
}
-require can_spawn_for_attach
-
set string_re {(?:[^\\"]|\\.)*}
set id_re "id=\"$decimal\""
@@ -21,14 +21,11 @@
# mi_run_cmd, it ignores whatever target the rest of GDB testsuite is
# using, and always tries to run natively. So, don't do anything unless
# we're actually testing native.
-require isnative
+require isnative !use_gdb_stub
if {![istarget *-linux*]} {
return
}
-# Check if start command is supported.
-require !use_gdb_stub
-
# The plan is for async mode to become the default but toggle for now.
set saved_gdbflags $GDBFLAGS
set GDBFLAGS [concat $GDBFLAGS " -ex \"set mi-async on\""]
@@ -30,15 +30,14 @@
# are using all-stop, or running, if we are using non-stop.
# Do not run if gdb debug is enabled as it doesn't work for separate-mi-tty.
-require !gdb_debug_enabled
+# Multiple inferiors are needed, therefore only native gdb and extended
+# gdbserver modes are supported.
+require !use_gdb_stub !gdb_debug_enabled
load_lib mi-support.exp
standard_testfile
-# Multiple inferiors are needed, therefore only native gdb and extended
-# gdbserver modes are supported.
-require !use_gdb_stub
set compile_options "debug pthreads"
if {[build_executable $testfile.exp $testfile ${srcfile} ${compile_options}] == -1} {
@@ -22,9 +22,7 @@ load_lib gdbserver-support.exp
standard_testfile
-require allow_gdbserver_tests
-
-require can_spawn_for_attach
+require allow_gdbserver_tests can_spawn_for_attach
if {[build_executable "build" $testfile $srcfile {debug}] == -1} {
return -1
@@ -18,11 +18,9 @@ set executable ${testfile}
# Multiple inferiors are needed, therefore both native and extended gdbserver
# modes are supported. Only non-extended gdbserver is not supported.
-require !use_gdb_stub
-
# Do not use simple hardware watchpoints ("watch") as its false hit may be
# unnoticed by GDB if it reads it still has the same value.
-require allow_hw_watchpoint_access_tests
+require !use_gdb_stub allow_hw_watchpoint_access_tests
if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested "failed to compile"
@@ -21,9 +21,7 @@ load_lib gdbserver-support.exp
standard_testfile
-require allow_gdbserver_tests
-
-require can_spawn_for_attach
+require allow_gdbserver_tests can_spawn_for_attach
# Start the test program, attach to it using gdbserver's --attach flag, connect
# to it with GDB, check that what we see makes sense.
@@ -22,9 +22,7 @@ load_lib trace-support.exp
standard_testfile
-require allow_gdbserver_tests
-
-require can_spawn_for_attach
+require allow_gdbserver_tests can_spawn_for_attach
if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
return -1
@@ -14,9 +14,7 @@
load_lib "trace-support.exp"
-require allow_shlib_tests
-
-require gdb_trace_common_supports_arch
+require allow_shlib_tests gdb_trace_common_supports_arch
standard_testfile
set libfile1 "change-loc-1"
@@ -14,7 +14,8 @@
load_lib "trace-support.exp"
-require allow_shlib_tests
+# Check that the target supports trace.
+require allow_shlib_tests gdb_trace_common_supports_arch
standard_testfile
set executable $testfile
@@ -30,8 +31,6 @@ set additional_flags [gdb_target_symbol_prefix_flags]
set options [list debug [gdb_target_symbol_prefix_flags] \
additional_flags=-DNUM_THREADS=$NUM_THREADS]
-# Check that the target supports trace.
-require gdb_trace_common_supports_arch
if { [gdb_compile_pthreads "$srcdir/$subdir/$srcfile" $binfile executable $options] != "" } {
untested "failed to compile"
return -1
@@ -14,7 +14,7 @@
load_lib "trace-support.exp"
-require allow_shlib_tests
+require allow_shlib_tests gdb_trace_common_supports_arch
standard_testfile
set executable $testfile
@@ -23,8 +23,6 @@ set expfile $testfile.exp
# Some targets have leading underscores on assembly symbols.
set additional_flags [gdb_target_symbol_prefix_flags]
-require gdb_trace_common_supports_arch
-
if [prepare_for_testing "failed to prepare" $executable $srcfile \
[list debug $additional_flags]] {
return -1
@@ -15,8 +15,7 @@
load_lib trace-support.exp
-require allow_shlib_tests
-require gdb_trace_common_supports_arch
+require allow_shlib_tests gdb_trace_common_supports_arch
standard_testfile pending.c
set libfile1 "pendshr1"
@@ -14,9 +14,7 @@
load_lib "trace-support.exp"
-require allow_shlib_tests
-
-require gdb_trace_common_supports_arch
+require allow_shlib_tests gdb_trace_common_supports_arch
standard_testfile
set libfile1 "pendshr1"
@@ -14,7 +14,7 @@
load_lib "trace-support.exp"
-require allow_shlib_tests
+require allow_shlib_tests gdb_trace_common_supports_arch
standard_testfile
set executable $testfile
@@ -23,8 +23,6 @@ set expfile $testfile.exp
# Some targets have leading underscores on assembly symbols.
set additional_flags [gdb_target_symbol_prefix_flags]
-require gdb_trace_common_supports_arch
-
if [prepare_for_testing "failed to prepare" $executable $srcfile \
[list debug $additional_flags]] {
return -1
@@ -14,7 +14,8 @@
load_lib "trace-support.exp"
-require allow_shlib_tests
+# Check that the target supports trace.
+require allow_shlib_tests gdb_trace_common_supports_arch
standard_testfile
set executable $testfile
@@ -23,8 +24,6 @@ set expfile $testfile.exp
# Some targets have leading underscores on assembly symbols.
set options [list debug [gdb_target_symbol_prefix_flags]]
-# Check that the target supports trace.
-require gdb_trace_common_supports_arch
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile executable $options] != "" } {
untested "failed to compile"
return -1