]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix require dwarf2_support check in some test-cases
authorTom de Vries <tdevries@suse.de>
Tue, 26 Aug 2025 10:24:19 +0000 (12:24 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 26 Aug 2025 10:24:19 +0000 (12:24 +0200)
On x86_64-freebsd, I ran into trouble with test-case
gdb.dwarf2/macro-source-path-clang14-dw4.exp (and similar), and I managed to
reproduce the problem on x86_64-linux by making dwarf2_support return 0.

The failure looks like:
...
UNSUPPORTED: $exp: require failed: dwarf2_support
UNRESOLVED: $exp: testcase aborted due to invalid command name: do_test
ERROR: tcl error sourcing $exp.
...

I fixed a similar problem in commit 3e488d8ccd0 ("[gdb/testsuite] Fix
gdb.dwarf2/dw-form-strx-out-of-bounds.exp with make-check-all.sh").

Fix this by moving "require dwarf2_support" from
gdb.dwarf2/macro-source-path.exp.tcl to the files including it.

Tested on x86_64-linux.

gdb/testsuite/gdb.dwarf2/macro-source-path-clang14-dw4.exp
gdb/testsuite/gdb.dwarf2/macro-source-path-clang14-dw5.exp
gdb/testsuite/gdb.dwarf2/macro-source-path-gcc11-ld234-dw5.exp
gdb/testsuite/gdb.dwarf2/macro-source-path-gcc11-ld238-dw4.exp
gdb/testsuite/gdb.dwarf2/macro-source-path-gcc11-ld238-dw5.exp
gdb/testsuite/gdb.dwarf2/macro-source-path.exp.tcl

index c0c2635a63e459292fb3572b3bfe0f27ad9608b4..dc3826e049291deb63381ddee19d74e12b15d9b7 100644 (file)
@@ -18,6 +18,8 @@
 # Generate binaries imitating different ways source file paths can be passed to
 # compilers.  Test printing macros from those binaries.
 
+require dwarf2_support
+
 # The do_test proc comes from macro-source-path.exp.tcl.
 source $srcdir/$subdir/macro-source-path.exp.tcl
 
index 0b3239edecdf0e6f232250ab980c055cda5fa568..a3ae2ea2cafbbff609aac5448dd61b537d9e9050 100644 (file)
@@ -18,6 +18,8 @@
 # Generate binaries imitating different ways source file paths can be passed to
 # compilers.  Test printing macros from those binaries.
 
+require dwarf2_support
+
 # The do_test proc comes from macro-source-path.exp.tcl.
 source $srcdir/$subdir/macro-source-path.exp.tcl
 
index 940f9976555f0ccda4ee0b26643c3119c3835663..79609813b52127c7f2a2796ac9aca426fe885a54 100644 (file)
@@ -18,6 +18,8 @@
 # Generate binaries imitating different ways source file paths can be passed to
 # compilers.  Test printing macros from those binaries.
 
+require dwarf2_support
+
 # The do_test proc comes from macro-source-path.exp.tcl.
 source $srcdir/$subdir/macro-source-path.exp.tcl
 
index dea03080c4d7f34e1f083444b9f70586530baa4b..62242453987b983891844e4d600ebfb53a742706 100644 (file)
@@ -18,6 +18,8 @@
 # Generate binaries imitating different ways source file paths can be passed to
 # compilers.  Test printing macros from those binaries.
 
+require dwarf2_support
+
 # The do_test proc comes from macro-source-path.exp.tcl.
 source $srcdir/$subdir/macro-source-path.exp.tcl
 
index 98a278e5e1e92f03b09b866104631eb9eb7fb5b4..37b03b9f55abe59f94765621ceac89406adde425 100644 (file)
@@ -18,6 +18,8 @@
 # Generate binaries imitating different ways source file paths can be passed to
 # compilers.  Test printing macros from those binaries.
 
+require dwarf2_support
+
 # The do_test proc comes from macro-source-path.exp.tcl.
 source $srcdir/$subdir/macro-source-path.exp.tcl
 
index ecaf6855af6eecb3a96d6187c1e27794b1415029..f45d1b05ab16ea57dcc71de70b70ef1d0008b603 100644 (file)
@@ -23,8 +23,6 @@
 
 load_lib dwarf.exp
 
-require dwarf2_support
-
 standard_testfile macro-source-path.c
 
 lassign [function_range main $srcdir/$subdir/$srcfile] \