From: Tom de Vries Date: Thu, 28 Aug 2025 09:24:42 +0000 (+0200) Subject: [gdb/testsuite] Fix require dwarf2_support check in some test-cases, some more X-Git-Tag: gdb-17-branchpoint~148 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e9303c4337161daf7f487daeb88488d3d5fbe129;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite] Fix require dwarf2_support check in some test-cases, some more The Linaro CI reported a regression in test-case gdb.dwarf2/macro-source-path-clang14-dw4.exp due to recent commit 81e5a23c7b8 ("[gdb/testsuite] Fix require dwarf2_support check in some test-cases"). The problem is that the "require dwarf2_support" in its new location doesn't work because proc dwarf2_support is not defined. I didn't notice this because I tested all gdb.dwarf2 test-cases together, and a different test-case had already imported the proc. Fix this by moving load_lib dwarf.exp earlier. 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 dc3826e0492..d4407d794b4 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. +load_lib dwarf.exp + require dwarf2_support # The do_test proc comes from 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 a3ae2ea2caf..23a40ba7890 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. +load_lib dwarf.exp + require dwarf2_support # The do_test proc comes from 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 79609813b52..99f785718c1 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. +load_lib dwarf.exp + require dwarf2_support # The do_test proc comes from 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 62242453987..569b4092c70 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. +load_lib dwarf.exp + require dwarf2_support # The do_test proc comes from 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 37b03b9f55a..0517d295bd1 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. +load_lib dwarf.exp + require dwarf2_support # The do_test proc comes from 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 f45d1b05ab1..6254286d56f 100644 --- a/gdb/testsuite/gdb.dwarf2/macro-source-path.exp.tcl +++ b/gdb/testsuite/gdb.dwarf2/macro-source-path.exp.tcl @@ -21,8 +21,6 @@ # The entry points for this test are in the various # gdb.dwarf2/macro-source-path-*.exp files. -load_lib dwarf.exp - standard_testfile macro-source-path.c lassign [function_range main $srcdir/$subdir/$srcfile] \