summaryrefslogtreecommitdiffstats
path: root/libunwind/src/libunwind.cpp
Commit message (Collapse)AuthorAgeFilesLines
* The semantics of DW_CFA_GNU_args_size have changed subtile over theJoerg Sonnenberger2018-07-171-1/+13
| | | | | | | | | | years. Adopt the new convention that it is call-site specific and that it should be applied before moving the IP by personality routines, but not during normal unwinding. Differential Revision: https://reviews.llvm.org/D38680 llvm-svn: 337312
* [libunwind][MIPS] Support MIPS floating-point registers for hard-float ABIs.John Baldwin2018-05-151-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: For MIPS ABIs with 64-bit floating point registers including newabi and O32 with 64-bit floating point registers, just save and restore the 32 floating-point registers as doubles. For O32 MIPS with 32-bit floating-point registers, save and restore the individual floating-point registers as "plain" registers. These registers are encoded as floats rather than doubles, but the DWARF unwinder assumes that floating-point registers are stored as doubles when reading them from memory (via AddressSpace::getDouble()). Treating the registers as "normal" registers instead causes the DWARF unwinder to fetch them from memory as a 32-bit register. This does mean that for O32 with 32-bit floating-point registers unw_get_fpreg() and unw_set_fpreg() do not work. One would have to use unw_get_reg() and unw_set_reg() instead. However, DWARF unwinding works correctly as the DWARF CFI emits records for individual 32-bit floating-point registers even when they are treated as doubles stored in paired registers. If the lack of unw_get/set_fpreg() becomes a pressing need in the future for O32 MIPS we could add in special handling to make it work. Reviewers: sdardis, compnerd Reviewed By: sdardis Differential Revision: https://reviews.llvm.org/D41968 llvm-svn: 332414
* [libunwind][MIPS]: Add support for unwinding in N32 processes.John Baldwin2018-02-271-2/+3
| | | | | | | | | | | | | | | | | | | | | | | Summary: N32 uses the same register context as N64. However, N32 requires one change to properly fetch addresses from registers stored in memory. Since N32 is an ILP32 platform, getP() only fetches the first 32-bits of a stored register. For a big-endian platform this fetches the upper 32-bits which will be zero. To fix this, add a new getRegister() method to AddressSpace which is responsible for extracting the address stored in a register in memory. This matches getP() for all current ABIs except for N32 where it reads the 64-bit register and returns the low 32-bits as an address. The DwarfInstructions::getSavedRegister() method uses AddressSpace::getRegister() instead of AddressSpace::getP(). Reviewers: sdardis, compnerd Reviewed By: sdardis Differential Revision: https://reviews.llvm.org/D39074 llvm-svn: 326250
* [libunwind][MIPS]: Rename Registers_mips_n64 to Registers_mips_newabi.John Baldwin2018-01-091-1/+1
| | | | | | | | | | | This is in preparation for adding support for N32 unwinding which reuses the newabi register class. Reviewed By: compnerd Differential Revision: https://reviews.llvm.org/D41842 llvm-svn: 322093
* Reland [PPC64] Port to ppc64le - initial versionMartin Storsjo2018-01-021-0/+2
| | | | | | | | | | | | | | | | | | | | | Initial working version of libunwind for PowerPC 64. Tested on little-endian ppc64 host only. Based on the existing PowerPC 32 code. It supports: - context save/restore (unw_getcontext, unw_init_local, unw_resume) - read/write from/to saved registers - backtrace (unw_step) Patch by Leandro Lupori! Differential Revision: https://reviews.llvm.org/D41386 Now builds with LIBUNWIND_ENABLE_CROSS_UNWINDING=ON should work. llvm-svn: 321680
* Revert `rL321667: [PPC64] Port to ppc64le - initial version`Tim Shen2018-01-021-2/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D41386 llvm-svn: 321678
* [PPC64] Port to ppc64le - initial versionMartin Storsjo2018-01-021-0/+2
| | | | | | | | | | | | | | | | | | Initial working version of libunwind for PowerPC 64. Tested on little-endian ppc64 host only. Based on the existing PowerPC 32 code. It supports: - context save/restore (unw_getcontext, unw_init_local, unw_resume) - read/write from/to saved registers - backtrace (unw_step) Patch by Leandro Lupori! Differential Revision: https://reviews.llvm.org/D41386 llvm-svn: 321667
* [libunwind][MIPS]: Add support for unwinding in O32 and N64 processes.John Baldwin2017-12-121-1/+5
| | | | | | | | | | | This supports the soft-float ABI only and has been tested with both clang and gcc on FreeBSD. Reviewed By: sdardis, compnerd Differential Revision: https://reviews.llvm.org/D38110 llvm-svn: 320528
* Fix building for ARM with dwarf exception handlingMartin Storsjo2017-11-021-1/+1
| | | | | | | | | | | | | | | | The previous definition of _LIBUNWIND_HIGHEST_DWARF_REGISTER seems to be a copy of the ARM64 value (introduced in SVN r276128); since the code actually hasn't compiled properly for arm in dwarf mode before, this hasn't actually been used. Set it to the correct value based on the UNW_ARM_* enum values. The iwmmx control variables have to be made mutable, since they are touched from within getRegister (which previously wasn't const), and getRegister is used on a const Registers object in DwarfInstructions.hpp. Differential Revision: https://reviews.llvm.org/D39251 llvm-svn: 317192
* Change unw_word_t to always have the same size as the pointer sizeMartin Storsjo2017-10-301-2/+2
| | | | | | | | | | | | | This matches the original libunwind API. This also unifies the type between ARM EHABI and the other configurations, and allows getting rid of a number of casts in log messages. The cursor size updates for ppc and or1k are untested, but unw_proc_info_t shrinks by 4 uint64_t units on i386 at least. Differential Revision: https://reviews.llvm.org/D39365 llvm-svn: 316942
* Skip building unused parts when targeting SJLJMartin Storsjo2017-09-261-0/+2
| | | | | | | | | | | When SJLJ exceptions are used, those functions aren't used. This fixes build failures on ARM with SJLJ enabled (e.g. on armv7/iOS) when built using the CMake project files. Differential Revision: https://reviews.llvm.org/D38249 llvm-svn: 314197
* [libunwind] Clean up macro usage.Ranjeet Singh2017-03-311-4/+4
| | | | | | | | Convention in libunwind is to use !defined(FOOT) not !FOO. Differential Revision: https://reviews.llvm.org/D31078 llvm-svn: 299225
* Fix up the places where AddressSpace.hpp is included.Ed Schouten2017-03-091-0/+1
| | | | | | | | | | | | | | | | The AddressSpace.hpp header declares two classes: LocalAddressSpace and RemoteAddressSpace. These classes are only used in a very small number of source files, but passed in as template arguments to many other classes. Let's go ahead and only include AddressSpace.hpp in source files where at least one of these two classes is mentioned. This gets rid of a cyclic header dependency that was already present, but only caused breakage on macOS until recently. Reported by: Marshall Clow llvm-svn: 297364
* DWARF: allow enabling tracing at runtimeSaleem Abdulrasool2017-01-211-0/+12
| | | | | | | Introduce `logDWARF` and the associated environment variable `LIBUNWIND_PRINT_DWARF` to trace the CFI instructions. llvm-svn: 292722
* rename OtherAddressSpace to RemoteAddressSpace; NFCSaleem Abdulrasool2017-01-211-6/+6
| | | | llvm-svn: 292719
* consistently add \n to log and trace messagesEd Maste2016-08-301-15/+15
| | | | | | | | | | Previously most messages included a newline in the string, but a few of them were missing. Fix these and simplify by just adding the newline in the _LIBUNWIND_LOG macro itself. Differential Revision: https://reviews.llvm.org/D24026 llvm-svn: 280103
* libunwind: correct 'libuwind' typoEd Maste2016-08-301-1/+1
| | | | | | | There were several instances of libuwind (missing an "n"), dating to the initial import of libunwind. llvm-svn: 280086
* libunwind: Use conventional DWARF capitalization in comments and errorsEd Maste2016-07-191-1/+1
| | | | llvm-svn: 275996
* Introduce a native-only unwinder build.Asiri Rathnayake2016-05-251-16/+13
| | | | | | | | | | | | | | | | Currently libunwind is built to support cross-unwinding [1] by default, which requires the buffers unw_context_t and unw_cursor_t to be large enough to hold the vritual register set (VRS) of any supported architecture. This is not desirable for some platforms where the stack usage of the unwinder needs to be kept to a minimum (e.g. bare-metal targets). The current patch introduces a native-only (-DLIBUNWIND_ENABLE_CROSS_UNWINDING=OFF) unwinder variant that adopts strict sizes for the buffers unw_context_t and unw_cursor_t depending on the target architecture. [1] http://www.nongnu.org/libunwind/man/libunwind(3).html#section_4 Change-Id: I380fff9a56c16a0fc520e3b1d8454a34b4a48373 llvm-svn: 270692
* unwind: Allow the building of libunwind for MIPS.Vasileios Kalintiris2015-09-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: Currently, libunwind doesn't support MIPS. However, with this patch we do allow the library to build, and we warn the user about the lack of support for MIPS. Also, the dummy unw_getcontext() implementation for MIPS just traps on function entry in order to avoid any confusion with silent/weird failures at runtime. This allows us to test an LLVM-based toolchain without the dependency on a GCC toolchain. Of course, C++ exception handling and other things that depend on stack unwinding will not work until we add a proper implementation of the stub functions. Reviewers: compnerd, logan Subscribers: dsanders, llvm-commits Differential Revision: http://reviews.llvm.org/D13160 llvm-svn: 248673
* [libunwind] Add support for OpenRISC 1000.Peter Zotov2015-08-311-0/+3
| | | | | | | | | This patch makes no assumptions on ABI past the ABI defined in the OpenRISC 1000 spec except that the DWARF register numbers will be 0-31 for registers r0-r31, which is true for both gcc and clang at the moment. llvm-svn: 246413
* [libunwind] Remove unused includes.Peter Zotov2015-08-271-3/+0
| | | | llvm-svn: 246143
* Enable zero-cost exceptions on non-Apple arm64 platformsEd Maste2015-08-131-1/+3
| | | | | | | | | | Use the canonical __aarch64__ predefined macro for 64-bit ARM. Apple- specific cases are left as __arm64__. Also add an #error for unsupported architectures to catch this sort of case in the future. Differential Revision: http://reviews.llvm.org/D12005 llvm-svn: 244893
* libunwind: Introduce __libunwind_config.h.Logan Chien2015-07-191-2/+2
| | | | | | | Introduce __libunwind_config.h to avoid cross repository circular dependency with libcxxabi. llvm-svn: 242642
* unwind: permit building against libstdc++Saleem Abdulrasool2015-05-111-0/+1
| | | | | | | | Include algorithm early as otherwise you get a number of particularly unhelpful messages about failed static assertions. This fixes compilation on Linux with gcc. llvm-svn: 237002
* unwind: move src/Unwind, include/, and test/ unwind contentSaleem Abdulrasool2015-04-241-0/+373
This moves the majority of the unwind sources into the new project layout for libunwind. This was previously discussed on llvmdev at [1]. This is a purely movement related change, with the build infrastructure currently still residing in the libc++abi repository. [1] http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-January/081507.html llvm-svn: 235758
OpenPOWER on IntegriCloud