Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2022-05-07 00:26:45 +0300
committerMartin Storsjö <martin@martin.st>2022-06-06 23:23:35 +0300
commit7c0e93cb89e6aa74881411213abf83faae7c58ee (patch)
tree83b43bb9cb753b758120313621a7b55ec79f64d6 /libunwind
parent03c19f41a26a8007b6c994eea3b3c308562e6d59 (diff)
[libunwind] Fix SEH unwinding on ARM
Check `__SEH__` when checking if ARM EHABI should be implied, similarly to 4a3722a2c3dff1fe885cc38bf43d3c095c9851e7 / D126866. Fix a warning by using the right format specifier (PRIxPTR instead of PRIx64), and add a double->float cast in a codepath that hasn't been built so far. This is enough to make SEH unwinding of itanium ABI exceptions on ARM mostly work - one specific issue is fixed in a separate follow-up patch. Differential Revision: https://reviews.llvm.org/D126867
Diffstat (limited to 'libunwind')
-rw-r--r--libunwind/include/__libunwind_config.h2
-rw-r--r--libunwind/include/libunwind.h2
-rw-r--r--libunwind/src/Unwind-seh.cpp4
-rw-r--r--libunwind/src/UnwindCursor.hpp2
4 files changed, 5 insertions, 5 deletions
diff --git a/libunwind/include/__libunwind_config.h b/libunwind/include/__libunwind_config.h
index e626567d4e59..5e9de90f649f 100644
--- a/libunwind/include/__libunwind_config.h
+++ b/libunwind/include/__libunwind_config.h
@@ -12,7 +12,7 @@
#define _LIBUNWIND_VERSION 15000
#if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \
- !defined(__ARM_DWARF_EH__)
+ !defined(__ARM_DWARF_EH__) && !defined(__SEH__)
#define _LIBUNWIND_ARM_EHABI
#endif
diff --git a/libunwind/include/libunwind.h b/libunwind/include/libunwind.h
index 3d8fd2146ebb..f878b46f0348 100644
--- a/libunwind/include/libunwind.h
+++ b/libunwind/include/libunwind.h
@@ -81,7 +81,7 @@ typedef struct unw_addr_space *unw_addr_space_t;
typedef int unw_regnum_t;
typedef uintptr_t unw_word_t;
-#if defined(__arm__) && !defined(__ARM_DWARF_EH__)
+#if defined(__arm__) && !defined(__ARM_DWARF_EH__) && !defined(__SEH__)
typedef uint64_t unw_fpreg_t;
#else
typedef double unw_fpreg_t;
diff --git a/libunwind/src/Unwind-seh.cpp b/libunwind/src/Unwind-seh.cpp
index f00bc4721ba4..64aaf0a383b8 100644
--- a/libunwind/src/Unwind-seh.cpp
+++ b/libunwind/src/Unwind-seh.cpp
@@ -255,8 +255,8 @@ unwind_phase2_forced(unw_context_t *uc,
(frameInfo.start_ip + offset > frameInfo.end_ip))
functionName = ".anonymous.";
_LIBUNWIND_TRACE_UNWINDING(
- "unwind_phase2_forced(ex_ojb=%p): start_ip=0x%" PRIx64
- ", func=%s, lsda=0x%" PRIx64 ", personality=0x%" PRIx64,
+ "unwind_phase2_forced(ex_ojb=%p): start_ip=0x%" PRIxPTR
+ ", func=%s, lsda=0x%" PRIxPTR ", personality=0x%" PRIxPTR,
(void *)exception_object, frameInfo.start_ip, functionName,
frameInfo.lsda, frameInfo.handler);
}
diff --git a/libunwind/src/UnwindCursor.hpp b/libunwind/src/UnwindCursor.hpp
index 6e8fc45ebfa8..dc334edbe385 100644
--- a/libunwind/src/UnwindCursor.hpp
+++ b/libunwind/src/UnwindCursor.hpp
@@ -863,7 +863,7 @@ void UnwindCursor<A, R>::setFloatReg(int regNum, unw_fpreg_t value) {
uint32_t w;
float f;
} d;
- d.f = value;
+ d.f = (float)value;
_msContext.S[regNum - UNW_ARM_S0] = d.w;
}
if (regNum >= UNW_ARM_D0 && regNum <= UNW_ARM_D31) {