[pushed] Use "require" a two gdb.dwarf2 test files

Tom Tromey tom@tromey.com
Fri Jan 31 05:52:47 GMT 2025


A couple of ".tcl" files in gdb.dwarf2 escaped notice during the
"require" refactoring.  This patch fixes these to use "require" rather
than if/return.
---
 gdb/testsuite/gdb.dwarf2/debug-names-tu.exp.tcl   | 4 +---
 gdb/testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl | 8 ++------
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/gdb/testsuite/gdb.dwarf2/debug-names-tu.exp.tcl b/gdb/testsuite/gdb.dwarf2/debug-names-tu.exp.tcl
index b688f4d7b7f..b7ed935de50 100644
--- a/gdb/testsuite/gdb.dwarf2/debug-names-tu.exp.tcl
+++ b/gdb/testsuite/gdb.dwarf2/debug-names-tu.exp.tcl
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile _start.c debug-names.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl b/gdb/testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl
index 5817b2b0f53..4a103fbe70a 100644
--- a/gdb/testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl
+++ b/gdb/testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl
@@ -18,14 +18,10 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # The .c files use __attribute__.
-if ![is_c_compiler_gcc] {
-    return 0
-}
+require is_c_compiler_gcc
 
 standard_testfile imported-unit-bp-alt.c .S imported-unit-bp-main.c
 
-- 
2.46.1



More information about the Gdb-patches mailing list