From: Tom de Vries Date: Tue, 26 Aug 2025 10:24:19 +0000 (+0200) Subject: [gdb/testsuite] Fix require dwarf2_support check in some test-cases X-Git-Tag: gdb-17-branchpoint~179 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=81e5a23c7b8;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite] Fix require dwarf2_support check in some test-cases 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. --- diff --git a/gdb/testsuite/gdb.dwarf2/macro-source-path-clang14-dw4.exp b/gdb/testsuite/gdb.dwarf2/macro-source-path-clang14-dw4.exp index c0c2635a63e..dc3826e0492 100644 --- a/gdb/testsuite/gdb.dwarf2/macro-source-path-clang14-dw4.exp +++ b/gdb/testsuite/gdb.dwarf2/macro-source-path-clang14-dw4.exp @@ -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 diff --git a/gdb/testsuite/gdb.dwarf2/macro-source-path-clang14-dw5.exp b/gdb/testsuite/gdb.dwarf2/macro-source-path-clang14-dw5.exp index 0b3239edecd..a3ae2ea2caf 100644 --- a/gdb/testsuite/gdb.dwarf2/macro-source-path-clang14-dw5.exp +++ b/gdb/testsuite/gdb.dwarf2/macro-source-path-clang14-dw5.exp @@ -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 diff --git a/gdb/testsuite/gdb.dwarf2/macro-source-path-gcc11-ld234-dw5.exp b/gdb/testsuite/gdb.dwarf2/macro-source-path-gcc11-ld234-dw5.exp index 940f9976555..79609813b52 100644 --- a/gdb/testsuite/gdb.dwarf2/macro-source-path-gcc11-ld234-dw5.exp +++ b/gdb/testsuite/gdb.dwarf2/macro-source-path-gcc11-ld234-dw5.exp @@ -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 diff --git a/gdb/testsuite/gdb.dwarf2/macro-source-path-gcc11-ld238-dw4.exp b/gdb/testsuite/gdb.dwarf2/macro-source-path-gcc11-ld238-dw4.exp index dea03080c4d..62242453987 100644 --- a/gdb/testsuite/gdb.dwarf2/macro-source-path-gcc11-ld238-dw4.exp +++ b/gdb/testsuite/gdb.dwarf2/macro-source-path-gcc11-ld238-dw4.exp @@ -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 diff --git a/gdb/testsuite/gdb.dwarf2/macro-source-path-gcc11-ld238-dw5.exp b/gdb/testsuite/gdb.dwarf2/macro-source-path-gcc11-ld238-dw5.exp index 98a278e5e1e..37b03b9f55a 100644 --- a/gdb/testsuite/gdb.dwarf2/macro-source-path-gcc11-ld238-dw5.exp +++ b/gdb/testsuite/gdb.dwarf2/macro-source-path-gcc11-ld238-dw5.exp @@ -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 diff --git a/gdb/testsuite/gdb.dwarf2/macro-source-path.exp.tcl b/gdb/testsuite/gdb.dwarf2/macro-source-path.exp.tcl index ecaf6855af6..f45d1b05ab1 100644 --- a/gdb/testsuite/gdb.dwarf2/macro-source-path.exp.tcl +++ b/gdb/testsuite/gdb.dwarf2/macro-source-path.exp.tcl @@ -23,8 +23,6 @@ load_lib dwarf.exp -require dwarf2_support - standard_testfile macro-source-path.c lassign [function_range main $srcdir/$subdir/$srcfile] \