summaryrefslogtreecommitdiffstats
path: root/src/UnwindRegistersRestore.S
Commit message (Collapse)AuthorAgeFilesLines
* Don't define unw_fpreg_t to uint64_t for __ARM_DWARF_EH__Martin Storsjo2019-01-291-4/+4
| | | | | | | | | | | | | | | | | | | | | The existing typedef of unw_fpreg_t to uint64_t might work and be correct for the ARM_EHABI case, but for dwarf, some cases in e.g. DwarfInstructions.hpp convert between double and unw_fpreg_t. When converting implicitly between double and unw_fpreg_t (uint64_t), the values get interpreted as integers and converted to float and vice versa, while the correct thing would be to keep the same bit pattern. Avoid the whole issue by using the same definition of unw_fpreg_t as all other architectures, when using dwarf unwinding on ARM. Change assembler functions to take a void pointer instead of unw_fpreg_t pointer, to avoid having a different mangled symbol name depending on the actual value of this typedef. Differential Revision: https://reviews.llvm.org/D57001 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@352461 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/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-22/+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/+22
| | | | | | | | | | | | | | | | | | | | | | 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
* [libunwind][mips] Modify the __mips_fpr macro checkStefan Maksimovic2018-08-161-1/+1
| | | | | | | | | The __mips_fpr macro can take the value of 0 as well, change to account for that case. Differential Revision: https://reviews.llvm.org/D50245 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@339848 91177308-0d34-0410-b5e6-96231b3b80d8
* [OR1K] Add a dedicated PC register to register state.whitequark2018-05-161-2/+4
| | | | | | | | | | | | Before this commit, R9, the link register, was used as PC register. However, a stack frame may have R9 not set to PC on entry, either because it uses a custom calling convention, or, more likely, because this is a signal or exception stack frame. Using R9 as PC register made it impossible to unwind such frames. All other architectures similarly use a dedicated PC register. git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@332512 91177308-0d34-0410-b5e6-96231b3b80d8
* [libunwind][MIPS] Support MIPS floating-point registers for hard-float ABIs.John Baldwin2018-05-151-3/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [PPC64] Added vector registers.Martin Storsjo2018-01-161-74/+244
| | | | | | | | | | | | | | | | The Registers_ppc64 class needed a couple of changes, both to accommodate the new registers as well as to handle the overlaps of VS register set without wasting space. The save/restore code of V and VS registers was added. As VS registers depend on the VMX extension, they are processed only if VMX support is detected (_ARCH_PWR8 for now). Patch by Leandro Lupori! Differential Revision: https://reviews.llvm.org/D41906 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@322596 91177308-0d34-0410-b5e6-96231b3b80d8
* [libunwind][MIPS]: Rename Registers_mips_n64 to Registers_mips_newabi.John Baldwin2018-01-091-2/+2
| | | | | | | | | | | | 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/+95
| | | | | | | | | | | | | | | | | | | | | 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-95/+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/+95
| | | | | | | | | | | | | | | | | | 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-0/+112
| | | | | | | | | | | | 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
* Add ifdefs around ELF specific parts of UnwindRegisters*.S for armMartin Storsjo2017-11-041-0/+10
| | | | | | | | This allows using dwarf exceptions on MinGW/ARM. Differential Revision: https://reviews.llvm.org/D39534 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@317423 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for dwarf unwinding on windows on x86_64Martin Storsjo2017-10-271-0/+28
| | | | | | | | | | | | | | | Clang doesn't currently support building for windows/x86_64 with dwarf by setting command line parameters, but if manually modified to use dwarf, we can make libunwind work in this configuration as well. Also include i386 in the docs when adding this as a supported configuration; libunwind already works for i386 windows, but can fail due to an issue unrelated to windows itself. Differential Revision: https://reviews.llvm.org/D38819 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@316747 91177308-0d34-0410-b5e6-96231b3b80d8
* Support DWARF unwinding on i386 windowsMartin Storsjo2017-10-111-0/+5
| | | | | | | | | In practice, with code built with clang, there are still unresolved issues with DW_CFA_GNU_args_size though. Differential Revision: https://reviews.llvm.org/D38679 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@315498 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix building on macOS after SVN r314492Martin Storsjo2017-10-021-3/+3
| | | | | | | | That commit incorrectly expanded the assumption that defined(__APPLE__) implies SjLj exception handling, which only is true within ARM code sections. git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@314695 91177308-0d34-0410-b5e6-96231b3b80d8
* Skip building x86 parts of UnwindRegisters*.S when targeting SjLjMartin Storsjo2017-09-291-1/+5
| | | | | | | | This extends SVN r314197 from the arm parts to the whole file. Differential Revision: https://reviews.llvm.org/D38381 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@314492 91177308-0d34-0410-b5e6-96231b3b80d8
* Skip building unused parts when targeting SJLJMartin Storsjo2017-09-261-1/+1
| | | | | | | | | | | 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
* [ARM] Adding .arch directives around WMMX unwind codeRenato Golin2016-08-261-0/+2
| | | | | | | | | | | Some unwind code is purposedly old enough to work on previous architecutres and they're guaranteed to never trigger in newer architectures, so we need to add .arch directives to tell the compiler/assembler that it's fine and we know what we're doing. Fixes PR29149. git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@279871 91177308-0d34-0410-b5e6-96231b3b80d8
* unwind: disable executable stacksSaleem Abdulrasool2016-08-051-0/+3
| | | | | | | Similar to compiler-rt, ensure that we disable executable stacks for the custom assembly. git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@277868 91177308-0d34-0410-b5e6-96231b3b80d8
* [libunwind][ARM] Add support for Thumb1 targetsOliver Stannard2016-07-251-3/+12
| | | | | | | | | | | | | | | | | | | | | The Thumb1 version of the code for saving and restoring the unwind context has a few bugs which prevent it from working: * It uses the STM instruction without writeback, which is not valid for Thumb1 (It was introduced in Thumb2). * It only saves/restores the low 8 registers, the sp and the lr, so if a program uses r8-r12 they will not be correctly restored when throwing an exception. There aren't currently any Thumb1 build-bots to test this, but we have been successfully running the libc++abi and libc++ test suites on Cortex-M0 models, as well as some other test suites that use C++ exceptions on a downstream version of libunwind with this patch applied. Differential Revision: https://reviews.llvm.org/D22292 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@276625 91177308-0d34-0410-b5e6-96231b3b80d8
* [libunwind][ARM] Improve unwinder stack usage - Make WMMX support optionalAsiri Rathnayake2016-07-071-4/+4
| | | | | | | | | | | | | | These registers are only available on a limited set of ARM targets (those based on XScale). Other targets should not have to pay the cost of these. This patch shaves off about ~300 bytes of stack usage and ~1KB of code-size. Differential revision: http://reviews.llvm.org/D21991 Reviewers: bcraig, compnerd Change-Id: I2d7a1911a193bd70b123e78747e1a7d1482463c7 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@274744 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] Fix libunwind build when using GNU assemblerRenato Golin2016-02-111-3/+3
| | | | | | | | | | | | | | | | | Use x29 and x30 for fp and lr respectively. This does not change the code generation with integrated asm but using x30 and x29 helps compile the code with gnu as. Currently gas fails to assemble this code with errors as below. Error: operand X should be an integer register. Newer versions of binutils should be fixed, but enough exists in the wild to make this change harmless and worthy. Patch by Khem Raj. git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@260595 91177308-0d34-0410-b5e6-96231b3b80d8
* [libunwind] Add support for OpenRISC 1000.Peter Zotov2015-08-311-0/+51
| | | | | | | | | 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
* unwind: move src/Unwind, include/, and test/ unwind contentSaleem Abdulrasool2015-04-241-0/+430
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