diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ChangeLog | 23 | ||||
-rw-r--r-- | tests/backtrace-data.c | 2 | ||||
-rw-r--r-- | tests/backtrace-dwarf.c | 13 | ||||
-rw-r--r-- | tests/backtrace-subr.sh | 3 | ||||
-rw-r--r-- | tests/backtrace.c | 13 | ||||
-rw-r--r-- | tests/cleanup-13.c | 24 |
6 files changed, 31 insertions, 47 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog index c68ae26c..63b7bed7 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,26 @@ +2014-01-04 Mark Wielaard <mjw@redhat.com> + + * backtrace-data.c (main): Don't assert if raise returns. + * backtrace-dwarf.c (report_pid): Call dwfl_linux_proc_attach with + assume_ptrace_attached true. + (ptrace_detach_stopped): Removed function. + (main): Don't call ptrace_detach_stopped. + * backtrace.c (ptrace_detach_stopped): Removed function. + (report_pid): Call dwfl_linux_proc_attach with assume_ptrace_attached + true. + (exec_dump): Don't call ptrace_detach_stopped. + +2014-01-04 Mark Wielaard <mjw@redhat.com> + + * backtrace-subr.sh (check_native_core): Skip, exit 77, the test + if we cannot adjust core ulimit. + +2014-01-04 Mark Wielaard <mjw@redhat.com> + + * cleanup-13.c (force_unwind_stop): Removed. + (force_unwind): Just call abort. Don't setup _Unwind_Exception and + don't call _Unwind_ForcedUnwind. + 2014-01-03 Mark Wielaard <mjw@redhat.com> * run-addrcfi.sh: Add case for EM_AARCH64. diff --git a/tests/backtrace-data.c b/tests/backtrace-data.c index 9fa3c4a9..dd74160a 100644 --- a/tests/backtrace-data.c +++ b/tests/backtrace-data.c @@ -278,7 +278,7 @@ main (int argc __attribute__ ((unused)), char **argv __attribute__ ((unused))) assert_perror (errno); assert (l == 0); raise (SIGUSR1); - assert (0); + return 0; default: break; } diff --git a/tests/backtrace-dwarf.c b/tests/backtrace-dwarf.c index 3a3e7632..f75e1202 100644 --- a/tests/backtrace-dwarf.c +++ b/tests/backtrace-dwarf.c @@ -42,7 +42,7 @@ report_pid (Dwfl *dwfl, pid_t pid) if (dwfl_report_end (dwfl, NULL, NULL) != 0) error (2, 0, "dwfl_report_end: %s", dwfl_errmsg (-1)); - result = dwfl_linux_proc_attach (dwfl, pid, false); + result = dwfl_linux_proc_attach (dwfl, pid, true); if (result < 0) error (2, 0, "dwfl_linux_proc_attach: %s", dwfl_errmsg (-1)); else if (result > 0) @@ -106,15 +106,6 @@ thread_callback (Dwfl_Thread *thread, void *thread_arg) error (1, 0, "dwfl_thread_getframes: %s", dwfl_errmsg (-1)); } -static void -ptrace_detach_stopped (pid_t pid) -{ - errno = 0; - long l = ptrace (PTRACE_DETACH, pid, NULL, (void *) (intptr_t) SIGSTOP); - assert_perror (errno); - assert (l == 0); -} - int main (int argc __attribute__ ((unused)), char **argv) { @@ -151,8 +142,6 @@ main (int argc __attribute__ ((unused)), char **argv) assert (WIFSTOPPED (status)); assert (WSTOPSIG (status) == SIGABRT); - ptrace_detach_stopped (pid); - Dwfl *dwfl = pid_to_dwfl (pid); dwfl_getthreads (dwfl, thread_callback, NULL); diff --git a/tests/backtrace-subr.sh b/tests/backtrace-subr.sh index 580a1cea..e7ece91c 100644 --- a/tests/backtrace-subr.sh +++ b/tests/backtrace-subr.sh @@ -109,7 +109,8 @@ check_native_core() SAVED_VALGRIND_CMD="$VALGRIND_CMD" unset VALGRIND_CMD - core="core.`ulimit -c unlimited; set +ex; testrun ${abs_builddir}/$child --gencore; true`" + # Skip the test if we cannot adjust core ulimit. + core="core.`ulimit -c unlimited || exit 77; set +ex; testrun ${abs_builddir}/$child --gencore; true`" if [ "x$SAVED_VALGRIND_CMD" != "x" ]; then VALGRIND_CMD="$SAVED_VALGRIND_CMD" diff --git a/tests/backtrace.c b/tests/backtrace.c index 64f90c43..758dfed6 100644 --- a/tests/backtrace.c +++ b/tests/backtrace.c @@ -260,15 +260,6 @@ prepare_thread (pid_t pid2 __attribute__ ((unused)), #define tgkill(pid, tid, sig) syscall (__NR_tgkill, (pid), (tid), (sig)) static void -ptrace_detach_stopped (pid_t pid) -{ - errno = 0; - long l = ptrace (PTRACE_DETACH, pid, NULL, (void *) (intptr_t) SIGSTOP); - assert_perror (errno); - assert (l == 0); -} - -static void report_pid (Dwfl *dwfl, pid_t pid) { int result = dwfl_linux_proc_report (dwfl, pid); @@ -280,7 +271,7 @@ report_pid (Dwfl *dwfl, pid_t pid) if (dwfl_report_end (dwfl, NULL, NULL) != 0) error (2, 0, "dwfl_report_end: %s", dwfl_errmsg (-1)); - result = dwfl_linux_proc_attach (dwfl, pid, false); + result = dwfl_linux_proc_attach (dwfl, pid, true); if (result < 0) error (2, 0, "dwfl_linux_proc_attach: %s", dwfl_errmsg (-1)); else if (result > 0) @@ -397,8 +388,6 @@ exec_dump (const char *exec) prepare_thread (pid2, jmp); } dwfl_end (dwfl); - ptrace_detach_stopped (pid); - ptrace_detach_stopped (pid2); check_tid = pid2; dwfl = pid_to_dwfl (pid); dump (dwfl); diff --git a/tests/cleanup-13.c b/tests/cleanup-13.c index b87c6965..3919b91a 100644 --- a/tests/cleanup-13.c +++ b/tests/cleanup-13.c @@ -283,30 +283,12 @@ extern char verify_it[sizeof (cfi_arch_program) - 0x80 < 0x3f80 ? 1 : -1]; : : "i" (sizeof (cfi_arch_program))) #endif #endif -static _Unwind_Reason_Code -force_unwind_stop (int version, _Unwind_Action actions, - _Unwind_Exception_Class exc_class, - struct _Unwind_Exception *exc_obj, - struct _Unwind_Context *context, - void *stop_parameter) -{ - if (actions & _UA_END_OF_STACK) - abort (); - return _URC_NO_REASON; -} + +/* The original GCC testcase tests the runtime unwinder using + _Unwind_ForcedUnwind, we just inspect the child when it aborts. */ static void force_unwind () { - struct _Unwind_Exception *exc = malloc (sizeof (*exc)); - memset (&exc->exception_class, 0, sizeof (exc->exception_class)); - exc->exception_cleanup = 0; - -#ifndef __USING_SJLJ_EXCEPTIONS__ - _Unwind_ForcedUnwind (exc, force_unwind_stop, 0); -#else - _Unwind_SjLj_ForcedUnwind (exc, force_unwind_stop, 0); -#endif - abort (); } |