summaryrefslogtreecommitdiffstats
path: root/src/libunwind.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [libunwind] Provide placement new definitionPetr Hosek2019-02-021-6/+3
| | | | | | | | | While Clang automatically generates the code for placement new, g++ doesn't do that so we need to provide our own definition. Differential Revision: https://reviews.llvm.org/D57455 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@352966 91177308-0d34-0410-b5e6-96231b3b80d8
* [libunwind] Remove the remote unwinding supportPetr Hosek2019-02-021-87/+0
| | | | | | | | | | This is unfinished, unused and incomplete. This could be brought back in the future if there's a desire to build a more complete implementation, but at the moment it's just bitrotting. Differential Revision: https://reviews.llvm.org/D57252 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@352965 91177308-0d34-0410-b5e6-96231b3b80d8
* Drop the dependency on <algorithm>, add placement new inlinePetr Hosek2019-01-291-4/+4
| | | | | | | | | | | | We haven't eliminated C++ library dependency altogether in D57251, UnwindCursor.hpp had an unused dependency on <algorithm> which was pulling in other C++ headers. Removing that dependency also revealed (correctly) that we need our own global placement new declaration. Now libunwind should be independent of the C++ library. Differential Revision: https://reviews.llvm.org/D57262 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@352553 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[libunwind] Drop the dependency on <algorithm>, add placement new ↵Petr Hosek2019-01-281-4/+4
| | | | | | | | | inline" This reverts commit r352384: this broke on ARM as UnwindCursor.hpp still has some C++ library dependencies. git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@352427 91177308-0d34-0410-b5e6-96231b3b80d8
* [libunwind] Drop the dependency on <algorithm>, add placement new inlinePetr Hosek2019-01-281-4/+4
| | | | | | | | | | | | We haven't eliminated C++ library dependency altogether in D57251, UnwindCursor.hpp had an unused dependency on <algorithm> which was pulling in other C++ headers. Removing that dependency also revealed (correctly) that we need our own global placement new declaration. Now libunwind should be independent of the C++ library. Differential Revision: https://reviews.llvm.org/D57262 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@352384 91177308-0d34-0410-b5e6-96231b3b80d8
* [libunwind] Use placement new to avoid dependency C++ libraryPetr Hosek2019-01-251-7/+10
| | | | | | | | | | The rest of libunwind already uses placement new, these are the only places where non-placement new is being used introducing undesirable C++ library dependency. Differential Revision: https://reviews.llvm.org/D57251 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@352245 91177308-0d34-0410-b5e6-96231b3b80d8
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | | to reflect the new license. These used slightly different spellings that defeated my regular expressions. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@351648 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sparc] Add Sparc V8 supportDaniel Cederman2019-01-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Adds the register class implementation for Sparc. Adds support for DW_CFA_GNU_window_save. Adds save and restore context functionality. Adds getArch() function to each Registers_ class to be able to separate between DW_CFA_AARCH64_negate_ra_state and DW_CFA_GNU_window_save which are both represented by the same constant. On Sparc the return address is the address of the call instruction, so an offset needs to be added when returning to skip the call instruction and its delay slot. If the function returns a struct it is also necessary to skip one extra instruction on Sparc V8. Reviewers: jyknight, mclow.lists, mstorsjo, compnerd Reviewed By: jyknight, compnerd Subscribers: jgorbe, mgorny, christof, llvm-commits, fedor.sergeev, JDevlieghere, ldionne, libcxx-commits Differential Revision: https://reviews.llvm.org/D55763 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@351044 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[Sparc] Add Sparc V8 support"Jorge Gorbe Moya2019-01-101-2/+0
| | | | | | This reverts commit r350705. git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@350787 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sparc] Add Sparc V8 supportDaniel Cederman2019-01-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: Adds the register class implementation for Sparc. Adds support for DW_CFA_GNU_window_save. Adds save and restore context functionality. On Sparc the return address is the address of the call instruction, so an offset needs to be added when returning to skip the call instruction and its delay slot. If the function returns a struct it is also necessary to skip one extra instruction. Reviewers: jyknight, mclow.lists, mstorsjo, compnerd Reviewed By: compnerd Subscribers: fedor.sergeev, JDevlieghere, ldionne, libcxx-commits Differential Revision: https://reviews.llvm.org/D55763 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@350705 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@337312 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@332414 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@326250 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@322093 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@321680 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert `rL321667: [PPC64] Port to ppc64le - initial version`Tim Shen2018-01-021-2/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D41386 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@321678 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@321667 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@320528 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@317192 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@316942 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@314197 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@299225 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@297364 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@292722 91177308-0d34-0410-b5e6-96231b3b80d8
* rename OtherAddressSpace to RemoteAddressSpace; NFCSaleem Abdulrasool2017-01-211-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@292719 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@280103 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@280086 91177308-0d34-0410-b5e6-96231b3b80d8
* libunwind: Use conventional DWARF capitalization in comments and errorsEd Maste2016-07-191-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@275996 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@270692 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@248673 91177308-0d34-0410-b5e6-96231b3b80d8
* [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. git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@246413 91177308-0d34-0410-b5e6-96231b3b80d8
* [libunwind] Remove unused includes.Peter Zotov2015-08-271-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@246143 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@244893 91177308-0d34-0410-b5e6-96231b3b80d8
* libunwind: Introduce __libunwind_config.h.Logan Chien2015-07-191-2/+2
| | | | | | | | Introduce __libunwind_config.h to avoid cross repository circular dependency with libcxxabi. git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@242642 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@237002 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@235758 91177308-0d34-0410-b5e6-96231b3b80d8