In order to have the DWARF_* macros working properly a generic and a local
variant of the ex_tables.c have been created.
Signed-off-by: Ken Werner <ken.werner@linaro.org>
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>
Dropping the extra frame for unw_backtrace itself using unw_step is
approximately 15% slower than skipping the frame in tdep_trace. So
drop the frame in the latter, and make the function a private
implementation detail for libunwind, not an exported interface.
Also moves unw_getcontext call back into unw_backtrace to avoid an
extra call frame in case slow_backtrace does not get inlined into
unw_backtrace.
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.
Usually we don't have a valid location for the SP but we keep calculating
the value of the CFA. The ARM backend should return this value instead.
Signed-off-by: Ken Werner <ken.werner@linaro.org>
Using malloc is not an option since unw_init_local and unw_step are supposed
to be async signal safe. Therefore this code path can be removed.
Signed-off-by: Ken Werner <ken.werner@linaro.org>
There is no need for libunwind to set/fake a name of the elf file from which
the program header came from.
Signed-off-by: Ken Werner <ken.werner@linaro.org>
DWARF expressions are more powerful than the ARM specific unwind tables.
Therefore DWARF should be the preferred unwind method.
Signed-off-by: Ken Werner <ken.werner@linaro.org>
Move code that does not necessarily need to reside in the ex_tables.h header
file into ex_tables.c. Add comments and remove unused code.
Signed-off-by: Ken Werner <ken.werner@linaro.org>
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>
This eliminates the arm_stackframe and therefore the need to synchronize the
two models. It also clears the way for unwinding call stacks with mixed
DWARF- and extbl-frames.
Signed-off-by: Ken Werner <ken.werner@linaro.org>
Uses ex_tables routines to provide a new means of unwinding the stack.
Set UNW_ARM_UNWIND_METHOD=4 to use ARM-specific unwinding tables.
Signed-off-by: Ken Werner <ken.werner@linaro.org>
Implements a check for call to sigreturn that the kernel will have
setup before jumping to the signal handler.
Signed-off-by: Ken Werner <ken.werner@linaro.org>
If mmap fails, be sure to close the maps file before returning an error.
Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
Signed-off-by: Ken Werner <ken.werner@linaro.org>
Avoids an endless loop when passing unknown options.
Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
Signed-off-by: Ken Werner <ken.werner@linaro.org>
This prevents the linker from complaining about a missing symbol when
building the test-setjmp test case.
Signed-off-by: Ken Werner <ken.werner@linaro.org>
This results in different unwi_unwind_method symbol names for the local and
generic versions. It allows to statically link against both libraries.
Signed-off-by: Ken Werner <ken.werner@linaro.org>
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>
in elf_map_image() to ensure mapped files have a valid ELF header.
Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
Signed-off-by: Arun Sharma <asharma@fb.com>
Eliminates obfuscating variables in favor of adding files directly
to library SOURCES. Eliminates the need for EXTRA_DIST variable.
Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
Rather than building the sources directly, create a library that
gets linked statically into libunwind.la and libunwind-$(arch).la.
Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
Build DWARF source files into automake convenience libraries to
eliminate duplication in arch-dependent library build rules.
Adds a configure-time check to determine whether to use them.
Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
Eliminate redundant listing of libunwind_setjmp source files by
using automake's '+=' operator.
Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
Use automake's '+=' to simplify include_HEADERS rules. Move most
EXTRA_DIST files to noinst_HEADERS, eliminating duplication of headers
listed by include_HEADERS. Add MIPS and PPC32 headers that were not
being distributed previously.
Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
Eliminates unused libraries from test program linking. Substitutes
'$(top_builddir)' for '..' to clarify library locations.
Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
The -static-libcxa test only applies for the Intel compiler, but the
check could pass for some versions of GCC. It would be accepted with
a warning in the past, but it produces an error with GCC 4.6.
Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
Ensure that --enable-debug-frame is set automatically when building
libunwind for an ARM target. Other targets continue to have
--disable-debug-frame as the default setting.
Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>