summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2017-10-27 08:11:36 +0000
committerMartin Storsjo <martin@martin.st>2017-10-27 08:11:36 +0000
commit86e02187700309c761da33928938200f2eba03e9 (patch)
treead56a3873a111d9febd4185b17ef707e26961194 /include
parentaf4b7dd015efae2d12d7387c39eab470d981113a (diff)
downloadlibunwind_llvm-86e02187700309c761da33928938200f2eba03e9.tar.gz
Add support for dwarf unwinding on windows on x86_64
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
Diffstat (limited to 'include')
-rw-r--r--include/__libunwind_config.h12
-rw-r--r--include/libunwind.h19
-rw-r--r--include/unwind.h2
3 files changed, 28 insertions, 5 deletions
diff --git a/include/__libunwind_config.h b/include/__libunwind_config.h
index 8043a22..92494b9 100644
--- a/include/__libunwind_config.h
+++ b/include/__libunwind_config.h
@@ -23,9 +23,15 @@
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 8
# elif defined(__x86_64__)
# define _LIBUNWIND_TARGET_X86_64 1
-# define _LIBUNWIND_CONTEXT_SIZE 21
-# define _LIBUNWIND_CURSOR_SIZE 33
-# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 16
+# if defined(_WIN64)
+# define _LIBUNWIND_CONTEXT_SIZE 54
+# define _LIBUNWIND_CURSOR_SIZE 66
+# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 32
+# else
+# define _LIBUNWIND_CONTEXT_SIZE 21
+# define _LIBUNWIND_CURSOR_SIZE 33
+# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 16
+# endif
# elif defined(__ppc__)
# define _LIBUNWIND_TARGET_PPC 1
# define _LIBUNWIND_CONTEXT_SIZE 117
diff --git a/include/libunwind.h b/include/libunwind.h
index cd09037..4df4183 100644
--- a/include/libunwind.h
+++ b/include/libunwind.h
@@ -188,7 +188,24 @@ enum {
UNW_X86_64_R12 = 12,
UNW_X86_64_R13 = 13,
UNW_X86_64_R14 = 14,
- UNW_X86_64_R15 = 15
+ UNW_X86_64_R15 = 15,
+ UNW_X86_64_RIP = 16,
+ UNW_X86_64_XMM0 = 17,
+ UNW_X86_64_XMM1 = 18,
+ UNW_X86_64_XMM2 = 19,
+ UNW_X86_64_XMM3 = 20,
+ UNW_X86_64_XMM4 = 21,
+ UNW_X86_64_XMM5 = 22,
+ UNW_X86_64_XMM6 = 23,
+ UNW_X86_64_XMM7 = 24,
+ UNW_X86_64_XMM8 = 25,
+ UNW_X86_64_XMM9 = 26,
+ UNW_X86_64_XMM10 = 27,
+ UNW_X86_64_XMM11 = 28,
+ UNW_X86_64_XMM12 = 29,
+ UNW_X86_64_XMM13 = 30,
+ UNW_X86_64_XMM14 = 31,
+ UNW_X86_64_XMM15 = 32,
};
diff --git a/include/unwind.h b/include/unwind.h
index 58dc3d9..0ab87dd 100644
--- a/include/unwind.h
+++ b/include/unwind.h
@@ -122,7 +122,7 @@ struct _Unwind_Exception {
_Unwind_Exception *exc);
uintptr_t private_1; // non-zero means forced unwind
uintptr_t private_2; // holds sp that phase1 found for phase2 to use
-#ifndef __LP64__
+#if __SIZEOF_POINTER__ == 4
// The implementation of _Unwind_Exception uses an attribute mode on the
// above fields which has the side effect of causing this whole struct to
// round up to 32 bytes in size. To be more explicit, we add pad fields