diff options
author | Martin Storsjö <martin@martin.st> | 2023-04-01 19:37:59 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2023-04-13 12:03:35 +0300 |
commit | 5b9d969e7c07d720080eac386467c1112c45a76f (patch) | |
tree | ce0884baafe9593004928633ec8b2544c2174b54 /libunwind | |
parent | 609420041b1827eeae2f7dbb5ea3a90652112d50 (diff) | |
download | llvm-5b9d969e7c07d720080eac386467c1112c45a76f.tar.gz |
[libunwind] [SEH] Allow setting/getting the register UNW_X86_64_RIP
This fixes libunwind_01.pass.cpp for x86_64 Windows.
Differential Revision: https://reviews.llvm.org/D147635
Diffstat (limited to 'libunwind')
-rw-r--r-- | libunwind/src/UnwindCursor.hpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libunwind/src/UnwindCursor.hpp b/libunwind/src/UnwindCursor.hpp index ac690badc261..9ea0cf1465e8 100644 --- a/libunwind/src/UnwindCursor.hpp +++ b/libunwind/src/UnwindCursor.hpp @@ -686,7 +686,7 @@ template <typename A, typename R> bool UnwindCursor<A, R>::validReg(int regNum) { if (regNum == UNW_REG_IP || regNum == UNW_REG_SP) return true; #if defined(_LIBUNWIND_TARGET_X86_64) - if (regNum >= UNW_X86_64_RAX && regNum <= UNW_X86_64_R15) return true; + if (regNum >= UNW_X86_64_RAX && regNum <= UNW_X86_64_RIP) return true; #elif defined(_LIBUNWIND_TARGET_ARM) if ((regNum >= UNW_ARM_R0 && regNum <= UNW_ARM_R15) || regNum == UNW_ARM_RA_AUTH_CODE) @@ -701,6 +701,7 @@ template <typename A, typename R> unw_word_t UnwindCursor<A, R>::getReg(int regNum) { switch (regNum) { #if defined(_LIBUNWIND_TARGET_X86_64) + case UNW_X86_64_RIP: case UNW_REG_IP: return _msContext.Rip; case UNW_X86_64_RAX: return _msContext.Rax; case UNW_X86_64_RDX: return _msContext.Rdx; @@ -751,6 +752,7 @@ template <typename A, typename R> void UnwindCursor<A, R>::setReg(int regNum, unw_word_t value) { switch (regNum) { #if defined(_LIBUNWIND_TARGET_X86_64) + case UNW_X86_64_RIP: case UNW_REG_IP: _msContext.Rip = value; break; case UNW_X86_64_RAX: _msContext.Rax = value; break; case UNW_X86_64_RDX: _msContext.Rdx = value; break; |