summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Merey <[email protected]>2024-02-29 19:46:09 -0500
committerAaron Merey <[email protected]>2024-02-29 19:46:09 -0500
commitc94a97a2a9d75d224bd2c31e9a33c90ec6e05444 (patch)
treed8a0adb91d8508745dd6aee2ab5f14246c570c92
parentd7768acc697735cc7498ddc891a1065439ba1d6f (diff)
tests/run-getsrc-die.sh: Avoid using objcopy
run-getsrc-die.sh uses objcopy to remove .debug_aranges from some testfiles. However depending how objcopy is built, it may fail to recognize the format of these testfiles. Avoid using objcopy and instead add versions of the testfiles to the testsuite with .debug_aranges already stripped. Signed-off-by: Aaron Merey <[email protected]>
-rwxr-xr-xtests/run-getsrc-die.sh11
-rw-r--r--tests/testfile-inlines-no-aranges.bz2bin0 -> 2673 bytes
-rw-r--r--tests/testfile-lex-inlines-no-aranges.bz2bin0 -> 2486 bytes
-rw-r--r--tests/testfile-no-aranges.bz2bin0 -> 7918 bytes
4 files changed, 4 insertions, 7 deletions
diff --git a/tests/run-getsrc-die.sh b/tests/run-getsrc-die.sh
index 54c7ad8c..40f62480 100755
--- a/tests/run-getsrc-die.sh
+++ b/tests/run-getsrc-die.sh
@@ -21,21 +21,18 @@
# Output/files/lines matched should equal what is done through addr2line
# which uses dwfl_module_getsrc. This test uses dwarf_addrdie and
# dwarf_getsrc_die
-testfiles testfile testfile-inlines testfile-lex-inlines
-tempfiles testfile-no-aranges testfile-inlines-no-aranges
+testfiles testfile testfile-inlines testfile-no-aranges
+testfiles testfile-lex-inlines testfile-inlines-no-aranges
tempfiles testfile-lex-inlines-no-aranges good.out getsrc_die.out
-# Each test should also pass with no .debug_aranges present.
-objcopy --remove-section .debug_aranges testfile testfile-no-aranges
-objcopy --remove-section .debug_aranges testfile-inlines testfile-inlines-no-aranges
-objcopy --remove-section .debug_aranges testfile-lex-inlines testfile-lex-inlines-no-aranges
-
cat > good.out <<\EOF
/home/drepper/gnu/new-bu/build/ttt/f.c:3
/home/drepper/gnu/new-bu/build/ttt/b.c:4
EOF
cat good.out | testrun_compare ${abs_top_builddir}/tests/getsrc_die testfile 0x08048468 0x0804845c
+
+# Each test should also pass with no .debug_aranges present.
cat good.out | testrun_compare ${abs_top_builddir}/tests/getsrc_die testfile-no-aranges 0x08048468 0x0804845c
cat > good.out <<\EOF
diff --git a/tests/testfile-inlines-no-aranges.bz2 b/tests/testfile-inlines-no-aranges.bz2
new file mode 100644
index 00000000..ab66b17e
--- /dev/null
+++ b/tests/testfile-inlines-no-aranges.bz2
Binary files differ
diff --git a/tests/testfile-lex-inlines-no-aranges.bz2 b/tests/testfile-lex-inlines-no-aranges.bz2
new file mode 100644
index 00000000..4ebc4522
--- /dev/null
+++ b/tests/testfile-lex-inlines-no-aranges.bz2
Binary files differ
diff --git a/tests/testfile-no-aranges.bz2 b/tests/testfile-no-aranges.bz2
new file mode 100644
index 00000000..a01db39c
--- /dev/null
+++ b/tests/testfile-no-aranges.bz2
Binary files differ