1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-11-06 01:34:29 +01:00
Commit graph

94 commits

Author SHA1 Message Date
Ulrich Weigand
4c62c4a955 Fix test case link failure on PowerPC systems with Altivec
On systems where the system compiler supports Altivec by default,
the libunwind Makefile will attempt to build an extra test case
ppc64-test-altivec.  Unfortunately, the link step will fail since
the Makefile does not actually link against the libunwind library.

Fixed by adding the appropriate LDADD macro.

Signed-off-by: Ulrich Weigand <uweigand@de.ibm.com>
2013-12-27 07:08:50 -08:00
Matt Fischer
61fad17d29 Build crasher test only when coredump support is enabled
The crasher test is used as part of the coredump test suite,
but is being built regardless of whether that support has been
configured or not.  This patch changes the build so that it is
only built when coredump support is enabled.
2013-04-19 17:08:09 -05:00
Matt Fischer
563b0ff314 Added --enable-setjmp
Currently, libunwind-setjmp is built whenever local unwinding is
built.  This patch adds an explicit flag to control it instead.
The default if not specified is to follow the old behavior.
2013-04-19 17:08:03 -05:00
Matt Fischer
abb0957198 Added --enable-ptrace
This change adds a manual override to control building of the ptrace
library, similar to the existing --enable-coredump option.  The
default is set based on the existence of sys/ptrace.h, allowing it
to be automatically disabled for platforms that do not have ptrace.
2013-04-19 16:46:24 -05:00
Arun Sharma
ae3dd9417a Add known test failures to XFAIL_TESTS 2012-10-27 19:37:45 -07:00
Tommi Rantala
58354c94d7 Nuke HAVE_BACKTRACE
We do not really need to care if the system provides `backtrace()',
since we will want to test the one provided in libunwind, not the one
that is provided by the system. The `backtrace()' calls should already
be aliased to `unw_backtrace()', but if that is not working for whatever
reason, we can call `unw_backtrace()' explicitly.
2012-09-28 14:50:03 +03:00
Tommi Rantala
7263a97ced Roll test-nocalloc' into Ltest-nocalloc.c'
We are building only a UNW_LOCAL_ONLY build of `test-nocalloc', and the
"generic" build would not be very interesting. Roll the whole test into
`Ltest-nocalloc.c'.
2012-09-28 14:50:03 +03:00
Tommi Rantala
643fc92e91 Rename rs-race' to Lrs-race'
Only build a "local-only" version of `rs-race'. The "generic" build is
not very entertaining, as the `unw_set_caching_policy()' calls
manipulate the `unw_local_addr_space' in libunwind-$arch.so, while the
`backtrace()' calls use the address space object from libunwind.so
behind the scenes.
2012-09-28 14:50:03 +03:00
Tommi Rantala
be230add88 Rename test-varargs' to Ltest-varargs'
This testcase only uses the local-only `unw_backtrace()' from libunwind,
and a "generic" build of this test case would not be interesting.
2012-09-28 14:50:02 +03:00
Cody P Schafer
b45c27b6ee ppc64: remove tests/ppc64-test-wchar
It is not clear what is special about wchar on PPC64, and no one can
remember why this was added.

Removing.
2012-09-15 10:47:42 -07:00
Cody P Schafer
3a5d7ff694 build: make libunwind-coredump build optional
Disable the building of libunwind-coredump except on x86_64 and x86
(where implimentations exsist).

Allow overriding of this autodetection via --enable-coredump and
--disable-coredump.
2012-09-15 10:47:42 -07:00
Tommi Rantala
8203c955c8 Change test-varargs to check libunwind backtracing
test-varargs is checking how `backtrace()' provided by the system
behaves when varargs are used. Let's make the test more useful by
changing it to test the `backtrace()' provided by libunwind.

Change the testcase to return 0/1 for success/failure, and add it to the
set of checks, so that it gets run on `make check'. Also call
`unw_backtrace()' explicitly so that we do not need to bother with
`execinfo.h' and `backtrace()' prototype.
2012-09-04 14:58:38 +03:00
Tommi Rantala
aed6c8b994 Check __builtin___clear_cache() at configuration time
Fixup commit 39b83981 ("Flush icache with __builtin___clear_cache() in
tests when compiling with GCC") to fix compilation with older GCC
versions that do not provide __builtin___clear_cache().
2012-09-04 13:26:13 +03:00
Tommi Rantala
5b55e556ca test-resume-sig-rt: test unw_resume() in presence of "realtime" signal frame
Introduce a new test case that is derived from test-resume-sig, but
using the SA_SIGINFO sigaction() flag. This case is referred in the
linux kernel sources as "realtime" signal handler, and is handled
differently in the kernel on many architectures and in libunwind as
well.
2012-08-21 22:33:56 +03:00
Arun Sharma
201bb8733d Use libtool to build libunwind-ptrace 2012-08-18 12:41:21 -07:00
Konstantin Belousov
04c77cced4 Fix for test suite build in the separate directory.
Avoid manually coding the rule to build crasher, instead fuddle
the compiler so that even -O2 optimization does not eliminate call
to b().

First, put calls to both a() and b() in the b() into non-tail-recursive
position. Second, as recommended in gcc manual, use asm volatile("");
to prevent further prevent inlining, besides attribute((noinline).
And third, call b() by alias, which current gcc optimizer cannot see
through.

Also, do not dereference NULL in a, and mark the memory access as volatile.
[ Minor portability improvements: asharma@fb.com ]
2012-08-11 22:02:55 -07:00
Martin Milata
4ab9e5dd10 MiniDebugInfo test: tests/run-coredump-unwind-mdi
Test that creates MiniDebugInfo-containing binary and then checks if it
can recover the procedure names from its coredump.

Signed-off-by: Martin Milata <mmilata@redhat.com>
2012-08-10 15:29:03 +02:00
Martin Milata
de28c51e63 Build libunwind-coredump using libtool
So that it builds shared/pic library that can be linked with other
libraries.

Signed-off-by: Martin Milata <mmilata@redhat.com>
2012-07-04 17:01:44 -07:00
Martin Milata
0f9a540c8c coredump: add test
Program test-coredump-unwind was modified to map backing files based on
virtual addresses instead of segment numbers.

The crasher.c is a program that essentially calls some functions and
then writes to invalid address causing a crash. Before that, it detects
which executables are mapped to which virtual addresses and writes this
information to a file suitable for consumption by test-coredump-unwind.
The mapping information is obtained form /proc/self/maps, so currently
it only works on linux.

The test itself is a shell script, which first runs the program and then
runs test-coredump-unwind on the resulting core and address space
map file to check whether the stack trace obtained from the dump roughly
corresponds to what it should look like.

Signed-off-by: Martin Milata <mmilata@redhat.com>
2012-05-31 11:00:40 +02:00
Martin Milata
d93d96ad83 Fix compilation on IA64
- Add tdep macro for {dwarf,ia64}_find_unwind_table so that ia64
   doesn't try to use dwarf code.
 - Fix extraneous #if.
 - Fix mistyped filename in Makefile.am.
 - Link ia64-specific tests with correct libraries.

Signed-off-by: Martin Milata <mmilata@redhat.com>
2012-05-23 20:52:28 -07:00
Arun Sharma
46dfe3ecf5 Fixup whitespace in Makefile. 2012-03-14 17:20:58 -07:00
Arun Sharma
f0bb806ecb Move the test case to tests dir. 2012-03-12 20:11:49 -07:00
Arun Sharma
42b67080eb Fix linker errors with recent binutils
Without this, tests that called unw_getcontext() got a linker error

Signed-off-by: Arun Sharma <asharma@fb.com>
2011-10-15 23:03:46 -07:00
Arun Sharma
1d8e2c1ae5 Explicitly specify the libraries
Without this linking fails with gold and newer versions of ld.
2011-09-10 19:57:10 -07:00
Sven Neumann
f195c9ad52 Skip a few tests on uCLibC
Without this, the build fails on platforms that don't implement
backtrace().
2011-08-27 21:54:52 -07:00
Ken Werner
d589e20506 Add the appropriate libraries to the *_LDADD variables.
The test-async-sig.c, test-flush-cache.c and Ltest_resume_sig.c define
UNW_LOCAL_ONLY and therefore only need LIBUNWIND_local. Gtest-dyn1.c is
calling '_U_dyn_cancel' and test-trace.c is using 'unw_backtrace' which
are in LIBUNWIND_local.

Signed-off-by: Ken Werner <ken.werner@linaro.org>
2011-04-21 17:25:42 +02:00
Arun Sharma
d86155f72e Add a test to catch calls to calloc from libunwind
We'd like to avoid calls to all malloc related functions
so libunwind is still usable from such allocators.

Signed-off-by: Paul Pluzhnikov <ppluzhnikov@google.com>
2011-04-05 20:59:03 -07:00
Arun Sharma
4dc222cf8a Undo parts of 2f9b04e9c2
Linking to local unwind library seems to be unrelated to
failures seen earlier.
2011-04-05 13:41:29 -07:00
Arun Sharma
2f9b04e9c2 Mark slow_backtrace() ALWAYS_INLINE
Also fix Makefile.am so remote unwinding tests such Gtest-trace
don't link with the local unwind library (libunwind.a).
2011-03-31 22:58:07 -07:00
Arun Sharma
741a5a2149 Add some performance tests for fast backtracing. 2011-03-25 00:20:46 -07:00
Arun Sharma
7ff83c051e Fix up compilation and test failures 2011-03-24 23:32:25 -07:00
Lassi Tuura
9e98f15e9a Fast back-trace for x86_64 for only collecting the call stack.
Adds new function to perform a pure stack walk without unwinding,
functionally similar to backtrace() but accelerated by an address
attribute cache the caller maintains across calls.
2011-03-24 22:33:17 -07:00
Arun Sharma
6c1a58fd06 Remove the unused arm_extbl_test_LDADD from Makefile.am 2011-03-24 21:49:17 -07:00
Ken Werner
6e25c11505 Remove the arm-extbl-test.
This test case relies on old libunwind internals such as the arm_stackframe.
Since the ARM extbtl-parser now operates on the DWARF model directly the
arm-extbl-test isn't of any particular use anymore.

Signed-off-by: Ken Werner <ken.werner@linaro.org>
2011-03-24 20:42:01 -07:00
Konstantin Belousov
04fc88fa31 Fix build and distribution on the FreeBSD.
Signed-off-by: Konstantin Belousov <kostikbel@gmail.com>
2011-03-24 20:41:07 -07:00
Arun Sharma
0613d4c680 Fixup trailing whitespace
Signed-off-by: Arun Sharma <asharma@fb.com>
2011-03-22 08:40:49 -07:00
Arun Sharma
57695518b3 Replace libuwind-elf32.la with $(LIBUNWIND_ELF)
This was needed to fix build errors on x86_64.

Signed-off-by: Arun Sharma <asharma@fb.com>
2011-03-22 08:34:33 -07:00
Zachary T Welch
4870386087 Add test of backtracing using ARM-specific tables
Uses .ARM.exidx and .ARM.extbl sections to produce a backtrace.

Signed-off-by: Ken Werner <ken.werner@linaro.org>
2011-03-22 08:15:03 -07:00
Ken Werner
c2cc122a62 Explicitly add dependent shared libraries.
This adds support for linkers that do not pull in the dependent shared
libraries of libunwind-$(arch).la and libunwind-setjmp.la implicitly.

Signed-off-by: Ken Werner <ken.werner@linaro.org>
2011-03-07 21:24:50 -08:00
Zachary T Welch
7e767a2838 Improve test LDADD settings.
Eliminates unused libraries from test program linking.  Substitutes
'$(top_builddir)' for '..' to clarify library locations.

Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
2010-11-29 11:28:35 -08:00
Zachary T Welch
651e9bb4fd Add MAINTAINERCLEANFILES to Makefile.am files.
Ensures 'make maintainer-clean' removes files generated by autotools.

Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
2010-11-08 09:06:09 -08:00
Arun Sharma
982d590ddb Add Gtest-nomalloc.c to EXTRA_DIST so we pass "make check" 2010-08-04 15:11:19 -07:00
Konstantin Belousov
74677edb23 Reverse local change 2010-04-20 17:54:16 +03:00
Konstantin Belousov
ee99dbec87 Use mincore instead of msync when available 2010-04-20 17:45:18 +03:00
Arun Sharma
c2d78041cc GCC compatibility on x86 for C++ exception handling 2010-04-12 12:08:43 -07:00
Konstantin Belousov
59d38aaccd Properly handle -ldl and -lutil 2010-03-07 12:46:05 +02:00
Paul Pluzhnikov
9626d66019 Fix a race condition in dwarf unwinding.
Original code was accessing rs_cache memory without holding a lock
in some cases. If there was sufficient cache pressure, entry being
accessed may be overwritten by another thread, resulting in a data
race.

We now make a thread local copy of the data, before releasing the
lock. If we end up supporting UNW_CACHE_PER_THREAD properly
in the future, this memcpy should be unnecessary.
2009-11-24 15:18:48 -08:00
Arun Sharma
576b59e4b1 Verify that we don't call malloc when unwinding locally. 2009-03-16 21:34:48 -07:00
Jose Flavio Aguilar Paulino
a1e7ee4836 Just a small patch to build system, it helps if you build in a power
without altivec.
2007-08-06 20:23:42 -06:00
Jose Flavio Aguilar Paulino
b33021e4b2 Add PPC64 support. 2007-08-02 09:59:43 -06:00