diff options
| author | Kurt Roeckx <[email protected]> | 2014-04-22 21:46:22 +0200 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2014-04-23 10:56:01 +0200 |
| commit | 02cefdaa6429e620d6457fdb3ad9934f194c5a93 (patch) | |
| tree | 7825fc20716a17ec96529d0b9e289ed549bf3185 /tests | |
| parent | 3232479483cad695d1872b879128a23da3953a7d (diff) | |
Unwinding is only supported on Linux
Signed-off-by: Kurt Roeckx <[email protected]>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ChangeLog | 8 | ||||
| -rw-r--r-- | tests/backtrace-child.c | 15 | ||||
| -rw-r--r-- | tests/backtrace-data.c | 4 | ||||
| -rw-r--r-- | tests/backtrace-dwarf.c | 15 | ||||
| -rw-r--r-- | tests/backtrace-subr.sh | 1 | ||||
| -rw-r--r-- | tests/backtrace.c | 15 |
6 files changed, 56 insertions, 2 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog index afec07fb..cf7b4635 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,11 @@ +2014-04-22 Kurt Roeckx <[email protected]> + + * backtrace.c: Make Linux only. + * backtrace-child.c: Make Linux only. + * backtrace-data.c: Make Linux only. + * backtrace-dwarf.c: Make Linux only. + * backtrace-subr.sh: Skip core file unwinding tests when not supported. + 2014-03-14 Mark Wielaard <[email protected]> * Makefile.am: Remove MUDFLAP conditions. Remove libmudflap from all diff --git a/tests/backtrace-child.c b/tests/backtrace-child.c index 512aa238..788801c3 100644 --- a/tests/backtrace-child.c +++ b/tests/backtrace-child.c @@ -79,6 +79,18 @@ #include <stdio.h> #include <unistd.h> +#ifndef __linux__ + +int +main (int argc __attribute__ ((unused)), char **argv) +{ + fprintf (stderr, "%s: Unwinding not supported for this architecture\n", + argv[0]); + return 77; +} + +#else /* __linux__ */ + #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) #define NOINLINE_NOCLONE __attribute__ ((noinline, noclone)) #else @@ -223,3 +235,6 @@ main (int argc UNUSED, char **argv) raise (SIGUSR2); return 0; } + +#endif /* ! __linux__ */ + diff --git a/tests/backtrace-data.c b/tests/backtrace-data.c index dd74160a..01c1c004 100644 --- a/tests/backtrace-data.c +++ b/tests/backtrace-data.c @@ -40,7 +40,7 @@ #include <string.h> #include ELFUTILS_HEADER(dwfl) -#ifndef __x86_64__ +#if !defined(__x86_64__) || !defined(__linux__) int main (int argc __attribute__ ((unused)), char **argv) @@ -50,7 +50,7 @@ main (int argc __attribute__ ((unused)), char **argv) return 77; } -#else /* __x86_64__ */ +#else /* __x86_64__ && __linux__ */ /* The only arch specific code is set_initial_registers. */ diff --git a/tests/backtrace-dwarf.c b/tests/backtrace-dwarf.c index f75e1202..87d088aa 100644 --- a/tests/backtrace-dwarf.c +++ b/tests/backtrace-dwarf.c @@ -25,6 +25,18 @@ #include <sys/ptrace.h> #include ELFUTILS_HEADER(dwfl) +#ifndef __linux__ + +int +main (int argc __attribute__ ((unused)), char **argv) +{ + fprintf (stderr, "%s: Unwinding not supported for this architecture\n", + argv[0]); + return 77; +} + +#else /* __linux__ */ + static void cleanup_13_abort (void); #define main cleanup_13_main #include "cleanup-13.c" @@ -148,3 +160,6 @@ main (int argc __attribute__ ((unused)), char **argv) /* There is an exit (0) call if we find the "main" frame, */ error (1, 0, "dwfl_getthreads: %s", dwfl_errmsg (-1)); } + +#endif /* ! __linux__ */ + diff --git a/tests/backtrace-subr.sh b/tests/backtrace-subr.sh index 1df93564..875e0b68 100644 --- a/tests/backtrace-subr.sh +++ b/tests/backtrace-subr.sh @@ -96,6 +96,7 @@ check_core() echo ./backtrace ./backtrace.$arch.{exec,core} testrun ${abs_builddir}/backtrace -e ./backtrace.$arch.exec --core=./backtrace.$arch.core 1>backtrace.$arch.bt 2>backtrace.$arch.err || true cat backtrace.$arch.{bt,err} + check_unsupported backtrace.$arch.err backtrace.$arch.core check_all backtrace.$arch.{bt,err} backtrace.$arch.core } diff --git a/tests/backtrace.c b/tests/backtrace.c index 758dfed6..1a4709b9 100644 --- a/tests/backtrace.c +++ b/tests/backtrace.c @@ -38,6 +38,18 @@ #include <argp.h> #include ELFUTILS_HEADER(dwfl) +#ifndef __linux__ + +int +main (int argc __attribute__ ((unused)), char **argv) +{ + fprintf (stderr, "%s: Unwinding not supported for this architecture\n", + argv[0]); + return 77; +} + +#else /* __linux__ */ + static int dump_modules (Dwfl_Module *mod, void **userdata __attribute__ ((unused)), const char *name, Dwarf_Addr start, @@ -451,3 +463,6 @@ main (int argc __attribute__ ((unused)), char **argv) dwfl_end (dwfl); return 0; } + +#endif /* ! __linux__ */ + |
