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.
# 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
# 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
# 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
# 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
# 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
load_lib dwarf.exp
-require dwarf2_support
-
standard_testfile macro-source-path.c
lassign [function_range main $srcdir/$subdir/$srcfile] \