diff --git a/.gitignore b/.gitignore index 9cd94d69..02bbaca9 100644 --- a/.gitignore +++ b/.gitignore @@ -87,5 +87,6 @@ tests/x64-unwind-badjmp-signal-frame tests/[GL]arm64-test-sve-signal tests/aarch64-test-plt tests/aarch64-test-frame-record +tests/[GL]arm-test-debug-frame-bt tests/*.log tests/*.trs diff --git a/tests/Garm-test-debug-frame-bt.c b/tests/Garm-test-debug-frame-bt.c new file mode 100644 index 00000000..d319fad9 --- /dev/null +++ b/tests/Garm-test-debug-frame-bt.c @@ -0,0 +1,13 @@ +#include +#include + +/* + * Run the backtrace test using the ARM DWARF unwinder based on the + * .debug_frame section. + */ +__attribute__((constructor)) +void set_dwarf(void) { + setenv("UNW_ARM_UNWIND_METHOD", "1", 1); +} + +#include "Gtest-bt.c" diff --git a/tests/Larm-test-debug-frame-bt.c b/tests/Larm-test-debug-frame-bt.c new file mode 100644 index 00000000..ba84ca3f --- /dev/null +++ b/tests/Larm-test-debug-frame-bt.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if !defined(UNW_REMOTE_ONLY) +#include "Garm-test-debug-frame-bt.c" +#endif diff --git a/tests/Makefile.am b/tests/Makefile.am index 60f3f3ad..0b46e885 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -86,6 +86,10 @@ endif #ARCH X86_64 endif #!ARCH_PPC64 endif #!ARCH_IA64 +if ARCH_ARM + check_PROGRAMS_arch += Garm-test-debug-frame-bt Larm-test-debug-frame-bt +endif + if ARCH_AARCH64 check_PROGRAMS_arch += Garm64-test-sve-signal Larm64-test-sve-signal \ aarch64-test-plt aarch64-test-frame-record @@ -249,6 +253,9 @@ Gx64_test_dwarf_expressions_SOURCES = Gx64-test-dwarf-expressions.c \ Lx64_test_dwarf_expressions_SOURCES = Lx64-test-dwarf-expressions.c \ x64-test-dwarf-expressions.S +Garm_test_debug_frame_bt_SOURCES = Garm-test-debug-frame-bt.c ident.c +Larm_test_debug_frame_bt_SOURCES = Larm-test-debug-frame-bt.c ident.c + Garm64_test_sve_signal_SOURCES = Garm64-test-sve-signal.c Larm64_test_sve_signal_SOURCES = Larm64-test-sve-signal.c aarch64_test_plt_SOURCES = aarch64-test-plt.c @@ -364,6 +371,9 @@ ppc64_test_plt_LDADD = $(LIBUNWIND) Gx64_test_dwarf_expressions_LDADD = $(LIBUNWIND) $(LIBUNWIND_local) Lx64_test_dwarf_expressions_LDADD = $(LIBUNWIND_local) +Garm_test_debug_frame_bt_LDADD = $(LIBUNWIND) $(LIBUNWIND_local) +Larm_test_debug_frame_bt_LDADD = $(LIBUNWIND_local) + Garm64_test_sve_signal_LDADD = $(LIBUNWIND) $(LIBUNWIND_local) Larm64_test_sve_signal_LDADD = $(LIBUNWIND_local) aarch64_test_plt_LDADD = $(LIBUNWIND)