aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/libunwind/include
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:17 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:17 +0300
commitd3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch)
treedd4bd3ca0f36b817e96812825ffaf10d645803f2 /contrib/libs/libunwind/include
parent72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff)
downloadydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/libunwind/include')
-rw-r--r--contrib/libs/libunwind/include/__libunwind_config.h24
-rw-r--r--contrib/libs/libunwind/include/libunwind.h846
-rw-r--r--contrib/libs/libunwind/include/mach-o/compact_unwind_encoding.h914
-rw-r--r--contrib/libs/libunwind/include/unwind.h344
-rw-r--r--contrib/libs/libunwind/include/unwind_arm_ehabi.h300
-rw-r--r--contrib/libs/libunwind/include/unwind_itanium.h100
6 files changed, 1264 insertions, 1264 deletions
diff --git a/contrib/libs/libunwind/include/__libunwind_config.h b/contrib/libs/libunwind/include/__libunwind_config.h
index 8cb3981f60..e87bcf4003 100644
--- a/contrib/libs/libunwind/include/__libunwind_config.h
+++ b/contrib/libs/libunwind/include/__libunwind_config.h
@@ -1,19 +1,19 @@
//===----------------------------------------------------------------------===//
-//
+//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef ____LIBUNWIND_CONFIG_H__
-#define ____LIBUNWIND_CONFIG_H__
-
-#if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \
- !defined(__ARM_DWARF_EH__)
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef ____LIBUNWIND_CONFIG_H__
+#define ____LIBUNWIND_CONFIG_H__
+
+#if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \
+ !defined(__ARM_DWARF_EH__)
#define _LIBUNWIND_ARM_EHABI
-#endif
-
+#endif
+
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86 8
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86_64 32
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC 112
@@ -181,4 +181,4 @@
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 287
#endif // _LIBUNWIND_IS_NATIVE_ONLY
-#endif // ____LIBUNWIND_CONFIG_H__
+#endif // ____LIBUNWIND_CONFIG_H__
diff --git a/contrib/libs/libunwind/include/libunwind.h b/contrib/libs/libunwind/include/libunwind.h
index 8e1a4266cf..8303c1a04c 100644
--- a/contrib/libs/libunwind/include/libunwind.h
+++ b/contrib/libs/libunwind/include/libunwind.h
@@ -1,24 +1,24 @@
//===----------------------------------------------------------------------===//
-//
+//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//
+//
+//
// Compatible with libunwind API documented at:
-// http://www.nongnu.org/libunwind/man/libunwind(3).html
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef __LIBUNWIND__
-#define __LIBUNWIND__
-
-#include "__libunwind_config.h"
-
-#include <stdint.h>
-#include <stddef.h>
-
-#ifdef __APPLE__
+// http://www.nongnu.org/libunwind/man/libunwind(3).html
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef __LIBUNWIND__
+#define __LIBUNWIND__
+
+#include "__libunwind_config.h"
+
+#include <stdint.h>
+#include <stddef.h>
+
+#ifdef __APPLE__
#if __clang__
#if __has_include(<Availability.h>)
#include <Availability.h>
@@ -35,140 +35,140 @@
#include <AvailabilityMacros.h>
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
#define LIBUNWIND_AVAIL AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
- #else
+ #else
#define LIBUNWIND_AVAIL __attribute__((unavailable))
- #endif
+ #endif
#endif
-#else
- #define LIBUNWIND_AVAIL
-#endif
-
+#else
+ #define LIBUNWIND_AVAIL
+#endif
+
#if defined(_WIN32) && defined(__SEH__)
#define LIBUNWIND_CURSOR_ALIGNMENT_ATTR __attribute__((__aligned__(16)))
#else
#define LIBUNWIND_CURSOR_ALIGNMENT_ATTR
#endif
-/* error codes */
-enum {
- UNW_ESUCCESS = 0, /* no error */
- UNW_EUNSPEC = -6540, /* unspecified (general) error */
- UNW_ENOMEM = -6541, /* out of memory */
- UNW_EBADREG = -6542, /* bad register number */
- UNW_EREADONLYREG = -6543, /* attempt to write read-only register */
- UNW_ESTOPUNWIND = -6544, /* stop unwinding */
- UNW_EINVALIDIP = -6545, /* invalid IP */
- UNW_EBADFRAME = -6546, /* bad frame */
- UNW_EINVAL = -6547, /* unsupported operation or bad value */
- UNW_EBADVERSION = -6548, /* unwind info has unsupported version */
- UNW_ENOINFO = -6549 /* no unwind info found */
+/* error codes */
+enum {
+ UNW_ESUCCESS = 0, /* no error */
+ UNW_EUNSPEC = -6540, /* unspecified (general) error */
+ UNW_ENOMEM = -6541, /* out of memory */
+ UNW_EBADREG = -6542, /* bad register number */
+ UNW_EREADONLYREG = -6543, /* attempt to write read-only register */
+ UNW_ESTOPUNWIND = -6544, /* stop unwinding */
+ UNW_EINVALIDIP = -6545, /* invalid IP */
+ UNW_EBADFRAME = -6546, /* bad frame */
+ UNW_EINVAL = -6547, /* unsupported operation or bad value */
+ UNW_EBADVERSION = -6548, /* unwind info has unsupported version */
+ UNW_ENOINFO = -6549 /* no unwind info found */
#if defined(_LIBUNWIND_TARGET_AARCH64) && !defined(_LIBUNWIND_IS_NATIVE_ONLY)
, UNW_ECROSSRASIGNING = -6550 /* cross unwind with return address signing */
#endif
-};
-
-struct unw_context_t {
+};
+
+struct unw_context_t {
uint64_t data[_LIBUNWIND_CONTEXT_SIZE];
-};
-typedef struct unw_context_t unw_context_t;
-
-struct unw_cursor_t {
+};
+typedef struct unw_context_t unw_context_t;
+
+struct unw_cursor_t {
uint64_t data[_LIBUNWIND_CURSOR_SIZE];
} LIBUNWIND_CURSOR_ALIGNMENT_ATTR;
-typedef struct unw_cursor_t unw_cursor_t;
-
-typedef struct unw_addr_space *unw_addr_space_t;
-
-typedef int unw_regnum_t;
+typedef struct unw_cursor_t unw_cursor_t;
+
+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__)
-typedef uint64_t unw_fpreg_t;
-#else
-typedef double unw_fpreg_t;
-#endif
-
-struct unw_proc_info_t {
- unw_word_t start_ip; /* start address of function */
- unw_word_t end_ip; /* address after end of function */
- unw_word_t lsda; /* address of language specific data area, */
- /* or zero if not used */
- unw_word_t handler; /* personality routine, or zero if not used */
- unw_word_t gp; /* not used */
- unw_word_t flags; /* not used */
- uint32_t format; /* compact unwind encoding, or zero if none */
+typedef uint64_t unw_fpreg_t;
+#else
+typedef double unw_fpreg_t;
+#endif
+
+struct unw_proc_info_t {
+ unw_word_t start_ip; /* start address of function */
+ unw_word_t end_ip; /* address after end of function */
+ unw_word_t lsda; /* address of language specific data area, */
+ /* or zero if not used */
+ unw_word_t handler; /* personality routine, or zero if not used */
+ unw_word_t gp; /* not used */
+ unw_word_t flags; /* not used */
+ uint32_t format; /* compact unwind encoding, or zero if none */
uint32_t unwind_info_size; /* size of DWARF unwind info, or zero if none */
unw_word_t unwind_info; /* address of DWARF unwind info, or zero */
- unw_word_t extra; /* mach_header of mach-o image containing func */
-};
-typedef struct unw_proc_info_t unw_proc_info_t;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int unw_getcontext(unw_context_t *) LIBUNWIND_AVAIL;
-extern int unw_init_local(unw_cursor_t *, unw_context_t *) LIBUNWIND_AVAIL;
-extern int unw_step(unw_cursor_t *) LIBUNWIND_AVAIL;
-extern int unw_get_reg(unw_cursor_t *, unw_regnum_t, unw_word_t *) LIBUNWIND_AVAIL;
-extern int unw_get_fpreg(unw_cursor_t *, unw_regnum_t, unw_fpreg_t *) LIBUNWIND_AVAIL;
-extern int unw_set_reg(unw_cursor_t *, unw_regnum_t, unw_word_t) LIBUNWIND_AVAIL;
-extern int unw_set_fpreg(unw_cursor_t *, unw_regnum_t, unw_fpreg_t) LIBUNWIND_AVAIL;
-extern int unw_resume(unw_cursor_t *) LIBUNWIND_AVAIL;
-
-#ifdef __arm__
-/* Save VFP registers in FSTMX format (instead of FSTMD). */
-extern void unw_save_vfp_as_X(unw_cursor_t *) LIBUNWIND_AVAIL;
-#endif
-
-
-extern const char *unw_regname(unw_cursor_t *, unw_regnum_t) LIBUNWIND_AVAIL;
-extern int unw_get_proc_info(unw_cursor_t *, unw_proc_info_t *) LIBUNWIND_AVAIL;
-extern int unw_is_fpreg(unw_cursor_t *, unw_regnum_t) LIBUNWIND_AVAIL;
-extern int unw_is_signal_frame(unw_cursor_t *) LIBUNWIND_AVAIL;
-extern int unw_get_proc_name(unw_cursor_t *, char *, size_t, unw_word_t *) LIBUNWIND_AVAIL;
-//extern int unw_get_save_loc(unw_cursor_t*, int, unw_save_loc_t*);
-
-extern unw_addr_space_t unw_local_addr_space;
-
-#ifdef __cplusplus
-}
-#endif
-
-// architecture independent register numbers
-enum {
- UNW_REG_IP = -1, // instruction pointer
- UNW_REG_SP = -2, // stack pointer
-};
-
-// 32-bit x86 registers
-enum {
- UNW_X86_EAX = 0,
- UNW_X86_ECX = 1,
- UNW_X86_EDX = 2,
- UNW_X86_EBX = 3,
- UNW_X86_EBP = 4,
- UNW_X86_ESP = 5,
- UNW_X86_ESI = 6,
- UNW_X86_EDI = 7
-};
-
-// 64-bit x86_64 registers
-enum {
- UNW_X86_64_RAX = 0,
- UNW_X86_64_RDX = 1,
- UNW_X86_64_RCX = 2,
- UNW_X86_64_RBX = 3,
- UNW_X86_64_RSI = 4,
- UNW_X86_64_RDI = 5,
- UNW_X86_64_RBP = 6,
- UNW_X86_64_RSP = 7,
- UNW_X86_64_R8 = 8,
- UNW_X86_64_R9 = 9,
- UNW_X86_64_R10 = 10,
- UNW_X86_64_R11 = 11,
- UNW_X86_64_R12 = 12,
- UNW_X86_64_R13 = 13,
- UNW_X86_64_R14 = 14,
+ unw_word_t extra; /* mach_header of mach-o image containing func */
+};
+typedef struct unw_proc_info_t unw_proc_info_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int unw_getcontext(unw_context_t *) LIBUNWIND_AVAIL;
+extern int unw_init_local(unw_cursor_t *, unw_context_t *) LIBUNWIND_AVAIL;
+extern int unw_step(unw_cursor_t *) LIBUNWIND_AVAIL;
+extern int unw_get_reg(unw_cursor_t *, unw_regnum_t, unw_word_t *) LIBUNWIND_AVAIL;
+extern int unw_get_fpreg(unw_cursor_t *, unw_regnum_t, unw_fpreg_t *) LIBUNWIND_AVAIL;
+extern int unw_set_reg(unw_cursor_t *, unw_regnum_t, unw_word_t) LIBUNWIND_AVAIL;
+extern int unw_set_fpreg(unw_cursor_t *, unw_regnum_t, unw_fpreg_t) LIBUNWIND_AVAIL;
+extern int unw_resume(unw_cursor_t *) LIBUNWIND_AVAIL;
+
+#ifdef __arm__
+/* Save VFP registers in FSTMX format (instead of FSTMD). */
+extern void unw_save_vfp_as_X(unw_cursor_t *) LIBUNWIND_AVAIL;
+#endif
+
+
+extern const char *unw_regname(unw_cursor_t *, unw_regnum_t) LIBUNWIND_AVAIL;
+extern int unw_get_proc_info(unw_cursor_t *, unw_proc_info_t *) LIBUNWIND_AVAIL;
+extern int unw_is_fpreg(unw_cursor_t *, unw_regnum_t) LIBUNWIND_AVAIL;
+extern int unw_is_signal_frame(unw_cursor_t *) LIBUNWIND_AVAIL;
+extern int unw_get_proc_name(unw_cursor_t *, char *, size_t, unw_word_t *) LIBUNWIND_AVAIL;
+//extern int unw_get_save_loc(unw_cursor_t*, int, unw_save_loc_t*);
+
+extern unw_addr_space_t unw_local_addr_space;
+
+#ifdef __cplusplus
+}
+#endif
+
+// architecture independent register numbers
+enum {
+ UNW_REG_IP = -1, // instruction pointer
+ UNW_REG_SP = -2, // stack pointer
+};
+
+// 32-bit x86 registers
+enum {
+ UNW_X86_EAX = 0,
+ UNW_X86_ECX = 1,
+ UNW_X86_EDX = 2,
+ UNW_X86_EBX = 3,
+ UNW_X86_EBP = 4,
+ UNW_X86_ESP = 5,
+ UNW_X86_ESI = 6,
+ UNW_X86_EDI = 7
+};
+
+// 64-bit x86_64 registers
+enum {
+ UNW_X86_64_RAX = 0,
+ UNW_X86_64_RDX = 1,
+ UNW_X86_64_RCX = 2,
+ UNW_X86_64_RBX = 3,
+ UNW_X86_64_RSI = 4,
+ UNW_X86_64_RDI = 5,
+ UNW_X86_64_RBP = 6,
+ UNW_X86_64_RSP = 7,
+ UNW_X86_64_R8 = 8,
+ UNW_X86_64_R9 = 9,
+ UNW_X86_64_R10 = 10,
+ UNW_X86_64_R11 = 11,
+ UNW_X86_64_R12 = 12,
+ UNW_X86_64_R13 = 13,
+ UNW_X86_64_R14 = 14,
UNW_X86_64_R15 = 15,
UNW_X86_64_RIP = 16,
UNW_X86_64_XMM0 = 17,
@@ -187,126 +187,126 @@ enum {
UNW_X86_64_XMM13 = 30,
UNW_X86_64_XMM14 = 31,
UNW_X86_64_XMM15 = 32,
-};
-
-
-// 32-bit ppc register numbers
-enum {
- UNW_PPC_R0 = 0,
- UNW_PPC_R1 = 1,
- UNW_PPC_R2 = 2,
- UNW_PPC_R3 = 3,
- UNW_PPC_R4 = 4,
- UNW_PPC_R5 = 5,
- UNW_PPC_R6 = 6,
- UNW_PPC_R7 = 7,
- UNW_PPC_R8 = 8,
- UNW_PPC_R9 = 9,
- UNW_PPC_R10 = 10,
- UNW_PPC_R11 = 11,
- UNW_PPC_R12 = 12,
- UNW_PPC_R13 = 13,
- UNW_PPC_R14 = 14,
- UNW_PPC_R15 = 15,
- UNW_PPC_R16 = 16,
- UNW_PPC_R17 = 17,
- UNW_PPC_R18 = 18,
- UNW_PPC_R19 = 19,
- UNW_PPC_R20 = 20,
- UNW_PPC_R21 = 21,
- UNW_PPC_R22 = 22,
- UNW_PPC_R23 = 23,
- UNW_PPC_R24 = 24,
- UNW_PPC_R25 = 25,
- UNW_PPC_R26 = 26,
- UNW_PPC_R27 = 27,
- UNW_PPC_R28 = 28,
- UNW_PPC_R29 = 29,
- UNW_PPC_R30 = 30,
- UNW_PPC_R31 = 31,
- UNW_PPC_F0 = 32,
- UNW_PPC_F1 = 33,
- UNW_PPC_F2 = 34,
- UNW_PPC_F3 = 35,
- UNW_PPC_F4 = 36,
- UNW_PPC_F5 = 37,
- UNW_PPC_F6 = 38,
- UNW_PPC_F7 = 39,
- UNW_PPC_F8 = 40,
- UNW_PPC_F9 = 41,
- UNW_PPC_F10 = 42,
- UNW_PPC_F11 = 43,
- UNW_PPC_F12 = 44,
- UNW_PPC_F13 = 45,
- UNW_PPC_F14 = 46,
- UNW_PPC_F15 = 47,
- UNW_PPC_F16 = 48,
- UNW_PPC_F17 = 49,
- UNW_PPC_F18 = 50,
- UNW_PPC_F19 = 51,
- UNW_PPC_F20 = 52,
- UNW_PPC_F21 = 53,
- UNW_PPC_F22 = 54,
- UNW_PPC_F23 = 55,
- UNW_PPC_F24 = 56,
- UNW_PPC_F25 = 57,
- UNW_PPC_F26 = 58,
- UNW_PPC_F27 = 59,
- UNW_PPC_F28 = 60,
- UNW_PPC_F29 = 61,
- UNW_PPC_F30 = 62,
- UNW_PPC_F31 = 63,
- UNW_PPC_MQ = 64,
- UNW_PPC_LR = 65,
- UNW_PPC_CTR = 66,
- UNW_PPC_AP = 67,
- UNW_PPC_CR0 = 68,
- UNW_PPC_CR1 = 69,
- UNW_PPC_CR2 = 70,
- UNW_PPC_CR3 = 71,
- UNW_PPC_CR4 = 72,
- UNW_PPC_CR5 = 73,
- UNW_PPC_CR6 = 74,
- UNW_PPC_CR7 = 75,
- UNW_PPC_XER = 76,
- UNW_PPC_V0 = 77,
- UNW_PPC_V1 = 78,
- UNW_PPC_V2 = 79,
- UNW_PPC_V3 = 80,
- UNW_PPC_V4 = 81,
- UNW_PPC_V5 = 82,
- UNW_PPC_V6 = 83,
- UNW_PPC_V7 = 84,
- UNW_PPC_V8 = 85,
- UNW_PPC_V9 = 86,
- UNW_PPC_V10 = 87,
- UNW_PPC_V11 = 88,
- UNW_PPC_V12 = 89,
- UNW_PPC_V13 = 90,
- UNW_PPC_V14 = 91,
- UNW_PPC_V15 = 92,
- UNW_PPC_V16 = 93,
- UNW_PPC_V17 = 94,
- UNW_PPC_V18 = 95,
- UNW_PPC_V19 = 96,
- UNW_PPC_V20 = 97,
- UNW_PPC_V21 = 98,
- UNW_PPC_V22 = 99,
- UNW_PPC_V23 = 100,
- UNW_PPC_V24 = 101,
- UNW_PPC_V25 = 102,
- UNW_PPC_V26 = 103,
- UNW_PPC_V27 = 104,
- UNW_PPC_V28 = 105,
- UNW_PPC_V29 = 106,
- UNW_PPC_V30 = 107,
- UNW_PPC_V31 = 108,
- UNW_PPC_VRSAVE = 109,
- UNW_PPC_VSCR = 110,
- UNW_PPC_SPE_ACC = 111,
- UNW_PPC_SPEFSCR = 112
-};
-
+};
+
+
+// 32-bit ppc register numbers
+enum {
+ UNW_PPC_R0 = 0,
+ UNW_PPC_R1 = 1,
+ UNW_PPC_R2 = 2,
+ UNW_PPC_R3 = 3,
+ UNW_PPC_R4 = 4,
+ UNW_PPC_R5 = 5,
+ UNW_PPC_R6 = 6,
+ UNW_PPC_R7 = 7,
+ UNW_PPC_R8 = 8,
+ UNW_PPC_R9 = 9,
+ UNW_PPC_R10 = 10,
+ UNW_PPC_R11 = 11,
+ UNW_PPC_R12 = 12,
+ UNW_PPC_R13 = 13,
+ UNW_PPC_R14 = 14,
+ UNW_PPC_R15 = 15,
+ UNW_PPC_R16 = 16,
+ UNW_PPC_R17 = 17,
+ UNW_PPC_R18 = 18,
+ UNW_PPC_R19 = 19,
+ UNW_PPC_R20 = 20,
+ UNW_PPC_R21 = 21,
+ UNW_PPC_R22 = 22,
+ UNW_PPC_R23 = 23,
+ UNW_PPC_R24 = 24,
+ UNW_PPC_R25 = 25,
+ UNW_PPC_R26 = 26,
+ UNW_PPC_R27 = 27,
+ UNW_PPC_R28 = 28,
+ UNW_PPC_R29 = 29,
+ UNW_PPC_R30 = 30,
+ UNW_PPC_R31 = 31,
+ UNW_PPC_F0 = 32,
+ UNW_PPC_F1 = 33,
+ UNW_PPC_F2 = 34,
+ UNW_PPC_F3 = 35,
+ UNW_PPC_F4 = 36,
+ UNW_PPC_F5 = 37,
+ UNW_PPC_F6 = 38,
+ UNW_PPC_F7 = 39,
+ UNW_PPC_F8 = 40,
+ UNW_PPC_F9 = 41,
+ UNW_PPC_F10 = 42,
+ UNW_PPC_F11 = 43,
+ UNW_PPC_F12 = 44,
+ UNW_PPC_F13 = 45,
+ UNW_PPC_F14 = 46,
+ UNW_PPC_F15 = 47,
+ UNW_PPC_F16 = 48,
+ UNW_PPC_F17 = 49,
+ UNW_PPC_F18 = 50,
+ UNW_PPC_F19 = 51,
+ UNW_PPC_F20 = 52,
+ UNW_PPC_F21 = 53,
+ UNW_PPC_F22 = 54,
+ UNW_PPC_F23 = 55,
+ UNW_PPC_F24 = 56,
+ UNW_PPC_F25 = 57,
+ UNW_PPC_F26 = 58,
+ UNW_PPC_F27 = 59,
+ UNW_PPC_F28 = 60,
+ UNW_PPC_F29 = 61,
+ UNW_PPC_F30 = 62,
+ UNW_PPC_F31 = 63,
+ UNW_PPC_MQ = 64,
+ UNW_PPC_LR = 65,
+ UNW_PPC_CTR = 66,
+ UNW_PPC_AP = 67,
+ UNW_PPC_CR0 = 68,
+ UNW_PPC_CR1 = 69,
+ UNW_PPC_CR2 = 70,
+ UNW_PPC_CR3 = 71,
+ UNW_PPC_CR4 = 72,
+ UNW_PPC_CR5 = 73,
+ UNW_PPC_CR6 = 74,
+ UNW_PPC_CR7 = 75,
+ UNW_PPC_XER = 76,
+ UNW_PPC_V0 = 77,
+ UNW_PPC_V1 = 78,
+ UNW_PPC_V2 = 79,
+ UNW_PPC_V3 = 80,
+ UNW_PPC_V4 = 81,
+ UNW_PPC_V5 = 82,
+ UNW_PPC_V6 = 83,
+ UNW_PPC_V7 = 84,
+ UNW_PPC_V8 = 85,
+ UNW_PPC_V9 = 86,
+ UNW_PPC_V10 = 87,
+ UNW_PPC_V11 = 88,
+ UNW_PPC_V12 = 89,
+ UNW_PPC_V13 = 90,
+ UNW_PPC_V14 = 91,
+ UNW_PPC_V15 = 92,
+ UNW_PPC_V16 = 93,
+ UNW_PPC_V17 = 94,
+ UNW_PPC_V18 = 95,
+ UNW_PPC_V19 = 96,
+ UNW_PPC_V20 = 97,
+ UNW_PPC_V21 = 98,
+ UNW_PPC_V22 = 99,
+ UNW_PPC_V23 = 100,
+ UNW_PPC_V24 = 101,
+ UNW_PPC_V25 = 102,
+ UNW_PPC_V26 = 103,
+ UNW_PPC_V27 = 104,
+ UNW_PPC_V28 = 105,
+ UNW_PPC_V29 = 106,
+ UNW_PPC_V30 = 107,
+ UNW_PPC_V31 = 108,
+ UNW_PPC_VRSAVE = 109,
+ UNW_PPC_VSCR = 110,
+ UNW_PPC_SPE_ACC = 111,
+ UNW_PPC_SPEFSCR = 112
+};
+
// 64-bit ppc register numbers
enum {
UNW_PPC64_R0 = 0,
@@ -491,8 +491,8 @@ enum {
UNW_PPC64_VS63 = UNW_PPC64_V31
};
-// 64-bit ARM64 registers
-enum {
+// 64-bit ARM64 registers
+enum {
UNW_AARCH64_X0 = 0,
UNW_AARCH64_X1 = 1,
UNW_AARCH64_X2 = 2,
@@ -530,7 +530,7 @@ enum {
UNW_AARCH64_SP = 31,
UNW_AARCH64_PC = 32,
- // reserved block
+ // reserved block
UNW_AARCH64_RA_SIGN_STATE = 34,
// FP/vector registers
@@ -637,176 +637,176 @@ enum {
UNW_ARM64_D29 = UNW_AARCH64_V29,
UNW_ARM64_D30 = UNW_AARCH64_V30,
UNW_ARM64_D31 = UNW_AARCH64_V31,
-};
-
-// 32-bit ARM registers. Numbers match DWARF for ARM spec #3.1 Table 1.
-// Naming scheme uses recommendations given in Note 4 for VFP-v2 and VFP-v3.
-// In this scheme, even though the 64-bit floating point registers D0-D31
-// overlap physically with the 32-bit floating pointer registers S0-S31,
-// they are given a non-overlapping range of register numbers.
-//
-// Commented out ranges are not preserved during unwinding.
-enum {
- UNW_ARM_R0 = 0,
- UNW_ARM_R1 = 1,
- UNW_ARM_R2 = 2,
- UNW_ARM_R3 = 3,
- UNW_ARM_R4 = 4,
- UNW_ARM_R5 = 5,
- UNW_ARM_R6 = 6,
- UNW_ARM_R7 = 7,
- UNW_ARM_R8 = 8,
- UNW_ARM_R9 = 9,
- UNW_ARM_R10 = 10,
- UNW_ARM_R11 = 11,
- UNW_ARM_R12 = 12,
- UNW_ARM_SP = 13, // Logical alias for UNW_REG_SP
- UNW_ARM_R13 = 13,
- UNW_ARM_LR = 14,
- UNW_ARM_R14 = 14,
- UNW_ARM_IP = 15, // Logical alias for UNW_REG_IP
- UNW_ARM_R15 = 15,
- // 16-63 -- OBSOLETE. Used in VFP1 to represent both S0-S31 and D0-D31.
- UNW_ARM_S0 = 64,
- UNW_ARM_S1 = 65,
- UNW_ARM_S2 = 66,
- UNW_ARM_S3 = 67,
- UNW_ARM_S4 = 68,
- UNW_ARM_S5 = 69,
- UNW_ARM_S6 = 70,
- UNW_ARM_S7 = 71,
- UNW_ARM_S8 = 72,
- UNW_ARM_S9 = 73,
- UNW_ARM_S10 = 74,
- UNW_ARM_S11 = 75,
- UNW_ARM_S12 = 76,
- UNW_ARM_S13 = 77,
- UNW_ARM_S14 = 78,
- UNW_ARM_S15 = 79,
- UNW_ARM_S16 = 80,
- UNW_ARM_S17 = 81,
- UNW_ARM_S18 = 82,
- UNW_ARM_S19 = 83,
- UNW_ARM_S20 = 84,
- UNW_ARM_S21 = 85,
- UNW_ARM_S22 = 86,
- UNW_ARM_S23 = 87,
- UNW_ARM_S24 = 88,
- UNW_ARM_S25 = 89,
- UNW_ARM_S26 = 90,
- UNW_ARM_S27 = 91,
- UNW_ARM_S28 = 92,
- UNW_ARM_S29 = 93,
- UNW_ARM_S30 = 94,
- UNW_ARM_S31 = 95,
- // 96-103 -- OBSOLETE. F0-F7. Used by the FPA system. Superseded by VFP.
- // 104-111 -- wCGR0-wCGR7, ACC0-ACC7 (Intel wireless MMX)
- UNW_ARM_WR0 = 112,
- UNW_ARM_WR1 = 113,
- UNW_ARM_WR2 = 114,
- UNW_ARM_WR3 = 115,
- UNW_ARM_WR4 = 116,
- UNW_ARM_WR5 = 117,
- UNW_ARM_WR6 = 118,
- UNW_ARM_WR7 = 119,
- UNW_ARM_WR8 = 120,
- UNW_ARM_WR9 = 121,
- UNW_ARM_WR10 = 122,
- UNW_ARM_WR11 = 123,
- UNW_ARM_WR12 = 124,
- UNW_ARM_WR13 = 125,
- UNW_ARM_WR14 = 126,
- UNW_ARM_WR15 = 127,
- // 128-133 -- SPSR, SPSR_{FIQ|IRQ|ABT|UND|SVC}
+};
+
+// 32-bit ARM registers. Numbers match DWARF for ARM spec #3.1 Table 1.
+// Naming scheme uses recommendations given in Note 4 for VFP-v2 and VFP-v3.
+// In this scheme, even though the 64-bit floating point registers D0-D31
+// overlap physically with the 32-bit floating pointer registers S0-S31,
+// they are given a non-overlapping range of register numbers.
+//
+// Commented out ranges are not preserved during unwinding.
+enum {
+ UNW_ARM_R0 = 0,
+ UNW_ARM_R1 = 1,
+ UNW_ARM_R2 = 2,
+ UNW_ARM_R3 = 3,
+ UNW_ARM_R4 = 4,
+ UNW_ARM_R5 = 5,
+ UNW_ARM_R6 = 6,
+ UNW_ARM_R7 = 7,
+ UNW_ARM_R8 = 8,
+ UNW_ARM_R9 = 9,
+ UNW_ARM_R10 = 10,
+ UNW_ARM_R11 = 11,
+ UNW_ARM_R12 = 12,
+ UNW_ARM_SP = 13, // Logical alias for UNW_REG_SP
+ UNW_ARM_R13 = 13,
+ UNW_ARM_LR = 14,
+ UNW_ARM_R14 = 14,
+ UNW_ARM_IP = 15, // Logical alias for UNW_REG_IP
+ UNW_ARM_R15 = 15,
+ // 16-63 -- OBSOLETE. Used in VFP1 to represent both S0-S31 and D0-D31.
+ UNW_ARM_S0 = 64,
+ UNW_ARM_S1 = 65,
+ UNW_ARM_S2 = 66,
+ UNW_ARM_S3 = 67,
+ UNW_ARM_S4 = 68,
+ UNW_ARM_S5 = 69,
+ UNW_ARM_S6 = 70,
+ UNW_ARM_S7 = 71,
+ UNW_ARM_S8 = 72,
+ UNW_ARM_S9 = 73,
+ UNW_ARM_S10 = 74,
+ UNW_ARM_S11 = 75,
+ UNW_ARM_S12 = 76,
+ UNW_ARM_S13 = 77,
+ UNW_ARM_S14 = 78,
+ UNW_ARM_S15 = 79,
+ UNW_ARM_S16 = 80,
+ UNW_ARM_S17 = 81,
+ UNW_ARM_S18 = 82,
+ UNW_ARM_S19 = 83,
+ UNW_ARM_S20 = 84,
+ UNW_ARM_S21 = 85,
+ UNW_ARM_S22 = 86,
+ UNW_ARM_S23 = 87,
+ UNW_ARM_S24 = 88,
+ UNW_ARM_S25 = 89,
+ UNW_ARM_S26 = 90,
+ UNW_ARM_S27 = 91,
+ UNW_ARM_S28 = 92,
+ UNW_ARM_S29 = 93,
+ UNW_ARM_S30 = 94,
+ UNW_ARM_S31 = 95,
+ // 96-103 -- OBSOLETE. F0-F7. Used by the FPA system. Superseded by VFP.
+ // 104-111 -- wCGR0-wCGR7, ACC0-ACC7 (Intel wireless MMX)
+ UNW_ARM_WR0 = 112,
+ UNW_ARM_WR1 = 113,
+ UNW_ARM_WR2 = 114,
+ UNW_ARM_WR3 = 115,
+ UNW_ARM_WR4 = 116,
+ UNW_ARM_WR5 = 117,
+ UNW_ARM_WR6 = 118,
+ UNW_ARM_WR7 = 119,
+ UNW_ARM_WR8 = 120,
+ UNW_ARM_WR9 = 121,
+ UNW_ARM_WR10 = 122,
+ UNW_ARM_WR11 = 123,
+ UNW_ARM_WR12 = 124,
+ UNW_ARM_WR13 = 125,
+ UNW_ARM_WR14 = 126,
+ UNW_ARM_WR15 = 127,
+ // 128-133 -- SPSR, SPSR_{FIQ|IRQ|ABT|UND|SVC}
// 134-142 -- Reserved
UNW_ARM_RA_AUTH_CODE = 143,
- // 144-150 -- R8_USR-R14_USR
- // 151-157 -- R8_FIQ-R14_FIQ
- // 158-159 -- R13_IRQ-R14_IRQ
- // 160-161 -- R13_ABT-R14_ABT
- // 162-163 -- R13_UND-R14_UND
- // 164-165 -- R13_SVC-R14_SVC
- // 166-191 -- Reserved
- UNW_ARM_WC0 = 192,
- UNW_ARM_WC1 = 193,
- UNW_ARM_WC2 = 194,
- UNW_ARM_WC3 = 195,
- // 196-199 -- wC4-wC7 (Intel wireless MMX control)
- // 200-255 -- Reserved
- UNW_ARM_D0 = 256,
- UNW_ARM_D1 = 257,
- UNW_ARM_D2 = 258,
- UNW_ARM_D3 = 259,
- UNW_ARM_D4 = 260,
- UNW_ARM_D5 = 261,
- UNW_ARM_D6 = 262,
- UNW_ARM_D7 = 263,
- UNW_ARM_D8 = 264,
- UNW_ARM_D9 = 265,
- UNW_ARM_D10 = 266,
- UNW_ARM_D11 = 267,
- UNW_ARM_D12 = 268,
- UNW_ARM_D13 = 269,
- UNW_ARM_D14 = 270,
- UNW_ARM_D15 = 271,
- UNW_ARM_D16 = 272,
- UNW_ARM_D17 = 273,
- UNW_ARM_D18 = 274,
- UNW_ARM_D19 = 275,
- UNW_ARM_D20 = 276,
- UNW_ARM_D21 = 277,
- UNW_ARM_D22 = 278,
- UNW_ARM_D23 = 279,
- UNW_ARM_D24 = 280,
- UNW_ARM_D25 = 281,
- UNW_ARM_D26 = 282,
- UNW_ARM_D27 = 283,
- UNW_ARM_D28 = 284,
- UNW_ARM_D29 = 285,
- UNW_ARM_D30 = 286,
- UNW_ARM_D31 = 287,
- // 288-319 -- Reserved for VFP/Neon
- // 320-8191 -- Reserved
- // 8192-16383 -- Unspecified vendor co-processor register.
-};
-
-// OpenRISC1000 register numbers
-enum {
- UNW_OR1K_R0 = 0,
- UNW_OR1K_R1 = 1,
- UNW_OR1K_R2 = 2,
- UNW_OR1K_R3 = 3,
- UNW_OR1K_R4 = 4,
- UNW_OR1K_R5 = 5,
- UNW_OR1K_R6 = 6,
- UNW_OR1K_R7 = 7,
- UNW_OR1K_R8 = 8,
- UNW_OR1K_R9 = 9,
- UNW_OR1K_R10 = 10,
- UNW_OR1K_R11 = 11,
- UNW_OR1K_R12 = 12,
- UNW_OR1K_R13 = 13,
- UNW_OR1K_R14 = 14,
- UNW_OR1K_R15 = 15,
- UNW_OR1K_R16 = 16,
- UNW_OR1K_R17 = 17,
- UNW_OR1K_R18 = 18,
- UNW_OR1K_R19 = 19,
- UNW_OR1K_R20 = 20,
- UNW_OR1K_R21 = 21,
- UNW_OR1K_R22 = 22,
- UNW_OR1K_R23 = 23,
- UNW_OR1K_R24 = 24,
- UNW_OR1K_R25 = 25,
- UNW_OR1K_R26 = 26,
- UNW_OR1K_R27 = 27,
- UNW_OR1K_R28 = 28,
- UNW_OR1K_R29 = 29,
- UNW_OR1K_R30 = 30,
- UNW_OR1K_R31 = 31,
+ // 144-150 -- R8_USR-R14_USR
+ // 151-157 -- R8_FIQ-R14_FIQ
+ // 158-159 -- R13_IRQ-R14_IRQ
+ // 160-161 -- R13_ABT-R14_ABT
+ // 162-163 -- R13_UND-R14_UND
+ // 164-165 -- R13_SVC-R14_SVC
+ // 166-191 -- Reserved
+ UNW_ARM_WC0 = 192,
+ UNW_ARM_WC1 = 193,
+ UNW_ARM_WC2 = 194,
+ UNW_ARM_WC3 = 195,
+ // 196-199 -- wC4-wC7 (Intel wireless MMX control)
+ // 200-255 -- Reserved
+ UNW_ARM_D0 = 256,
+ UNW_ARM_D1 = 257,
+ UNW_ARM_D2 = 258,
+ UNW_ARM_D3 = 259,
+ UNW_ARM_D4 = 260,
+ UNW_ARM_D5 = 261,
+ UNW_ARM_D6 = 262,
+ UNW_ARM_D7 = 263,
+ UNW_ARM_D8 = 264,
+ UNW_ARM_D9 = 265,
+ UNW_ARM_D10 = 266,
+ UNW_ARM_D11 = 267,
+ UNW_ARM_D12 = 268,
+ UNW_ARM_D13 = 269,
+ UNW_ARM_D14 = 270,
+ UNW_ARM_D15 = 271,
+ UNW_ARM_D16 = 272,
+ UNW_ARM_D17 = 273,
+ UNW_ARM_D18 = 274,
+ UNW_ARM_D19 = 275,
+ UNW_ARM_D20 = 276,
+ UNW_ARM_D21 = 277,
+ UNW_ARM_D22 = 278,
+ UNW_ARM_D23 = 279,
+ UNW_ARM_D24 = 280,
+ UNW_ARM_D25 = 281,
+ UNW_ARM_D26 = 282,
+ UNW_ARM_D27 = 283,
+ UNW_ARM_D28 = 284,
+ UNW_ARM_D29 = 285,
+ UNW_ARM_D30 = 286,
+ UNW_ARM_D31 = 287,
+ // 288-319 -- Reserved for VFP/Neon
+ // 320-8191 -- Reserved
+ // 8192-16383 -- Unspecified vendor co-processor register.
+};
+
+// OpenRISC1000 register numbers
+enum {
+ UNW_OR1K_R0 = 0,
+ UNW_OR1K_R1 = 1,
+ UNW_OR1K_R2 = 2,
+ UNW_OR1K_R3 = 3,
+ UNW_OR1K_R4 = 4,
+ UNW_OR1K_R5 = 5,
+ UNW_OR1K_R6 = 6,
+ UNW_OR1K_R7 = 7,
+ UNW_OR1K_R8 = 8,
+ UNW_OR1K_R9 = 9,
+ UNW_OR1K_R10 = 10,
+ UNW_OR1K_R11 = 11,
+ UNW_OR1K_R12 = 12,
+ UNW_OR1K_R13 = 13,
+ UNW_OR1K_R14 = 14,
+ UNW_OR1K_R15 = 15,
+ UNW_OR1K_R16 = 16,
+ UNW_OR1K_R17 = 17,
+ UNW_OR1K_R18 = 18,
+ UNW_OR1K_R19 = 19,
+ UNW_OR1K_R20 = 20,
+ UNW_OR1K_R21 = 21,
+ UNW_OR1K_R22 = 22,
+ UNW_OR1K_R23 = 23,
+ UNW_OR1K_R24 = 24,
+ UNW_OR1K_R25 = 25,
+ UNW_OR1K_R26 = 26,
+ UNW_OR1K_R27 = 27,
+ UNW_OR1K_R28 = 28,
+ UNW_OR1K_R29 = 29,
+ UNW_OR1K_R30 = 30,
+ UNW_OR1K_R31 = 31,
UNW_OR1K_EPCR = 32,
-};
-
+};
+
// MIPS registers
enum {
UNW_MIPS_R0 = 0,
@@ -1174,4 +1174,4 @@ enum {
UNW_VE_VL = 145,
};
-#endif
+#endif
diff --git a/contrib/libs/libunwind/include/mach-o/compact_unwind_encoding.h b/contrib/libs/libunwind/include/mach-o/compact_unwind_encoding.h
index 45d873f75c..68d562eec4 100644
--- a/contrib/libs/libunwind/include/mach-o/compact_unwind_encoding.h
+++ b/contrib/libs/libunwind/include/mach-o/compact_unwind_encoding.h
@@ -1,477 +1,477 @@
//===----------------------------------------------------------------------===//
-//
+//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//
+//
+//
// Darwin's alternative to DWARF based unwind encodings.
-//
-//===----------------------------------------------------------------------===//
-
-
-#ifndef __COMPACT_UNWIND_ENCODING__
-#define __COMPACT_UNWIND_ENCODING__
-
-#include <stdint.h>
-
-//
+//
+//===----------------------------------------------------------------------===//
+
+
+#ifndef __COMPACT_UNWIND_ENCODING__
+#define __COMPACT_UNWIND_ENCODING__
+
+#include <stdint.h>
+
+//
// Compilers can emit standard DWARF FDEs in the __TEXT,__eh_frame section
-// of object files. Or compilers can emit compact unwind information in
-// the __LD,__compact_unwind section.
-//
-// When the linker creates a final linked image, it will create a
-// __TEXT,__unwind_info section. This section is a small and fast way for the
-// runtime to access unwind info for any given function. If the compiler
-// emitted compact unwind info for the function, that compact unwind info will
-// be encoded in the __TEXT,__unwind_info section. If the compiler emitted
+// of object files. Or compilers can emit compact unwind information in
+// the __LD,__compact_unwind section.
+//
+// When the linker creates a final linked image, it will create a
+// __TEXT,__unwind_info section. This section is a small and fast way for the
+// runtime to access unwind info for any given function. If the compiler
+// emitted compact unwind info for the function, that compact unwind info will
+// be encoded in the __TEXT,__unwind_info section. If the compiler emitted
// DWARF unwind info, the __TEXT,__unwind_info section will contain the offset
-// of the FDE in the __TEXT,__eh_frame section in the final linked image.
-//
+// of the FDE in the __TEXT,__eh_frame section in the final linked image.
+//
// Note: Previously, the linker would transform some DWARF unwind infos into
-// compact unwind info. But that is fragile and no longer done.
-
-
-//
-// The compact unwind endoding is a 32-bit value which encoded in an
-// architecture specific way, which registers to restore from where, and how
-// to unwind out of the function.
-//
-typedef uint32_t compact_unwind_encoding_t;
-
-
-// architecture independent bits
-enum {
- UNWIND_IS_NOT_FUNCTION_START = 0x80000000,
- UNWIND_HAS_LSDA = 0x40000000,
- UNWIND_PERSONALITY_MASK = 0x30000000,
-};
-
-
-
-
-//
-// x86
-//
-// 1-bit: start
-// 1-bit: has lsda
-// 2-bit: personality index
-//
+// compact unwind info. But that is fragile and no longer done.
+
+
+//
+// The compact unwind endoding is a 32-bit value which encoded in an
+// architecture specific way, which registers to restore from where, and how
+// to unwind out of the function.
+//
+typedef uint32_t compact_unwind_encoding_t;
+
+
+// architecture independent bits
+enum {
+ UNWIND_IS_NOT_FUNCTION_START = 0x80000000,
+ UNWIND_HAS_LSDA = 0x40000000,
+ UNWIND_PERSONALITY_MASK = 0x30000000,
+};
+
+
+
+
+//
+// x86
+//
+// 1-bit: start
+// 1-bit: has lsda
+// 2-bit: personality index
+//
// 4-bits: 0=old, 1=ebp based, 2=stack-imm, 3=stack-ind, 4=DWARF
-// ebp based:
-// 15-bits (5*3-bits per reg) register permutation
-// 8-bits for stack offset
-// frameless:
-// 8-bits stack size
-// 3-bits stack adjust
-// 3-bits register count
-// 10-bits register permutation
-//
-enum {
- UNWIND_X86_MODE_MASK = 0x0F000000,
- UNWIND_X86_MODE_EBP_FRAME = 0x01000000,
- UNWIND_X86_MODE_STACK_IMMD = 0x02000000,
- UNWIND_X86_MODE_STACK_IND = 0x03000000,
- UNWIND_X86_MODE_DWARF = 0x04000000,
-
- UNWIND_X86_EBP_FRAME_REGISTERS = 0x00007FFF,
- UNWIND_X86_EBP_FRAME_OFFSET = 0x00FF0000,
-
- UNWIND_X86_FRAMELESS_STACK_SIZE = 0x00FF0000,
- UNWIND_X86_FRAMELESS_STACK_ADJUST = 0x0000E000,
- UNWIND_X86_FRAMELESS_STACK_REG_COUNT = 0x00001C00,
- UNWIND_X86_FRAMELESS_STACK_REG_PERMUTATION = 0x000003FF,
-
- UNWIND_X86_DWARF_SECTION_OFFSET = 0x00FFFFFF,
-};
-
-enum {
- UNWIND_X86_REG_NONE = 0,
- UNWIND_X86_REG_EBX = 1,
- UNWIND_X86_REG_ECX = 2,
- UNWIND_X86_REG_EDX = 3,
- UNWIND_X86_REG_EDI = 4,
- UNWIND_X86_REG_ESI = 5,
- UNWIND_X86_REG_EBP = 6,
-};
-
-//
-// For x86 there are four modes for the compact unwind encoding:
-// UNWIND_X86_MODE_EBP_FRAME:
-// EBP based frame where EBP is push on stack immediately after return address,
-// then ESP is moved to EBP. Thus, to unwind ESP is restored with the current
-// EPB value, then EBP is restored by popping off the stack, and the return
-// is done by popping the stack once more into the pc.
-// All non-volatile registers that need to be restored must have been saved
-// in a small range in the stack that starts EBP-4 to EBP-1020. The offset/4
-// is encoded in the UNWIND_X86_EBP_FRAME_OFFSET bits. The registers saved
-// are encoded in the UNWIND_X86_EBP_FRAME_REGISTERS bits as five 3-bit entries.
-// Each entry contains which register to restore.
-// UNWIND_X86_MODE_STACK_IMMD:
-// A "frameless" (EBP not used as frame pointer) function with a small
-// constant stack size. To return, a constant (encoded in the compact
-// unwind encoding) is added to the ESP. Then the return is done by
-// popping the stack into the pc.
-// All non-volatile registers that need to be restored must have been saved
-// on the stack immediately after the return address. The stack_size/4 is
-// encoded in the UNWIND_X86_FRAMELESS_STACK_SIZE (max stack size is 1024).
-// The number of registers saved is encoded in UNWIND_X86_FRAMELESS_STACK_REG_COUNT.
-// UNWIND_X86_FRAMELESS_STACK_REG_PERMUTATION constains which registers were
-// saved and their order.
-// UNWIND_X86_MODE_STACK_IND:
-// A "frameless" (EBP not used as frame pointer) function large constant
-// stack size. This case is like the previous, except the stack size is too
-// large to encode in the compact unwind encoding. Instead it requires that
-// the function contains "subl $nnnnnnnn,ESP" in its prolog. The compact
-// encoding contains the offset to the nnnnnnnn value in the function in
-// UNWIND_X86_FRAMELESS_STACK_SIZE.
-// UNWIND_X86_MODE_DWARF:
-// No compact unwind encoding is available. Instead the low 24-bits of the
+// ebp based:
+// 15-bits (5*3-bits per reg) register permutation
+// 8-bits for stack offset
+// frameless:
+// 8-bits stack size
+// 3-bits stack adjust
+// 3-bits register count
+// 10-bits register permutation
+//
+enum {
+ UNWIND_X86_MODE_MASK = 0x0F000000,
+ UNWIND_X86_MODE_EBP_FRAME = 0x01000000,
+ UNWIND_X86_MODE_STACK_IMMD = 0x02000000,
+ UNWIND_X86_MODE_STACK_IND = 0x03000000,
+ UNWIND_X86_MODE_DWARF = 0x04000000,
+
+ UNWIND_X86_EBP_FRAME_REGISTERS = 0x00007FFF,
+ UNWIND_X86_EBP_FRAME_OFFSET = 0x00FF0000,
+
+ UNWIND_X86_FRAMELESS_STACK_SIZE = 0x00FF0000,
+ UNWIND_X86_FRAMELESS_STACK_ADJUST = 0x0000E000,
+ UNWIND_X86_FRAMELESS_STACK_REG_COUNT = 0x00001C00,
+ UNWIND_X86_FRAMELESS_STACK_REG_PERMUTATION = 0x000003FF,
+
+ UNWIND_X86_DWARF_SECTION_OFFSET = 0x00FFFFFF,
+};
+
+enum {
+ UNWIND_X86_REG_NONE = 0,
+ UNWIND_X86_REG_EBX = 1,
+ UNWIND_X86_REG_ECX = 2,
+ UNWIND_X86_REG_EDX = 3,
+ UNWIND_X86_REG_EDI = 4,
+ UNWIND_X86_REG_ESI = 5,
+ UNWIND_X86_REG_EBP = 6,
+};
+
+//
+// For x86 there are four modes for the compact unwind encoding:
+// UNWIND_X86_MODE_EBP_FRAME:
+// EBP based frame where EBP is push on stack immediately after return address,
+// then ESP is moved to EBP. Thus, to unwind ESP is restored with the current
+// EPB value, then EBP is restored by popping off the stack, and the return
+// is done by popping the stack once more into the pc.
+// All non-volatile registers that need to be restored must have been saved
+// in a small range in the stack that starts EBP-4 to EBP-1020. The offset/4
+// is encoded in the UNWIND_X86_EBP_FRAME_OFFSET bits. The registers saved
+// are encoded in the UNWIND_X86_EBP_FRAME_REGISTERS bits as five 3-bit entries.
+// Each entry contains which register to restore.
+// UNWIND_X86_MODE_STACK_IMMD:
+// A "frameless" (EBP not used as frame pointer) function with a small
+// constant stack size. To return, a constant (encoded in the compact
+// unwind encoding) is added to the ESP. Then the return is done by
+// popping the stack into the pc.
+// All non-volatile registers that need to be restored must have been saved
+// on the stack immediately after the return address. The stack_size/4 is
+// encoded in the UNWIND_X86_FRAMELESS_STACK_SIZE (max stack size is 1024).
+// The number of registers saved is encoded in UNWIND_X86_FRAMELESS_STACK_REG_COUNT.
+// UNWIND_X86_FRAMELESS_STACK_REG_PERMUTATION constains which registers were
+// saved and their order.
+// UNWIND_X86_MODE_STACK_IND:
+// A "frameless" (EBP not used as frame pointer) function large constant
+// stack size. This case is like the previous, except the stack size is too
+// large to encode in the compact unwind encoding. Instead it requires that
+// the function contains "subl $nnnnnnnn,ESP" in its prolog. The compact
+// encoding contains the offset to the nnnnnnnn value in the function in
+// UNWIND_X86_FRAMELESS_STACK_SIZE.
+// UNWIND_X86_MODE_DWARF:
+// No compact unwind encoding is available. Instead the low 24-bits of the
// compact encoding is the offset of the DWARF FDE in the __eh_frame section.
-// This mode is never used in object files. It is only generated by the
+// This mode is never used in object files. It is only generated by the
// linker in final linked images which have only DWARF unwind info for a
-// function.
-//
-// The permutation encoding is a Lehmer code sequence encoded into a
-// single variable-base number so we can encode the ordering of up to
-// six registers in a 10-bit space.
-//
-// The following is the algorithm used to create the permutation encoding used
-// with frameless stacks. It is passed the number of registers to be saved and
-// an array of the register numbers saved.
-//
-//uint32_t permute_encode(uint32_t registerCount, const uint32_t registers[6])
-//{
-// uint32_t renumregs[6];
-// for (int i=6-registerCount; i < 6; ++i) {
-// int countless = 0;
-// for (int j=6-registerCount; j < i; ++j) {
-// if ( registers[j] < registers[i] )
-// ++countless;
-// }
-// renumregs[i] = registers[i] - countless -1;
-// }
-// uint32_t permutationEncoding = 0;
-// switch ( registerCount ) {
-// case 6:
-// permutationEncoding |= (120*renumregs[0] + 24*renumregs[1]
-// + 6*renumregs[2] + 2*renumregs[3]
-// + renumregs[4]);
-// break;
-// case 5:
-// permutationEncoding |= (120*renumregs[1] + 24*renumregs[2]
-// + 6*renumregs[3] + 2*renumregs[4]
-// + renumregs[5]);
-// break;
-// case 4:
-// permutationEncoding |= (60*renumregs[2] + 12*renumregs[3]
-// + 3*renumregs[4] + renumregs[5]);
-// break;
-// case 3:
-// permutationEncoding |= (20*renumregs[3] + 4*renumregs[4]
-// + renumregs[5]);
-// break;
-// case 2:
-// permutationEncoding |= (5*renumregs[4] + renumregs[5]);
-// break;
-// case 1:
-// permutationEncoding |= (renumregs[5]);
-// break;
-// }
-// return permutationEncoding;
-//}
-//
-
-
-
-
-//
-// x86_64
-//
-// 1-bit: start
-// 1-bit: has lsda
-// 2-bit: personality index
-//
+// function.
+//
+// The permutation encoding is a Lehmer code sequence encoded into a
+// single variable-base number so we can encode the ordering of up to
+// six registers in a 10-bit space.
+//
+// The following is the algorithm used to create the permutation encoding used
+// with frameless stacks. It is passed the number of registers to be saved and
+// an array of the register numbers saved.
+//
+//uint32_t permute_encode(uint32_t registerCount, const uint32_t registers[6])
+//{
+// uint32_t renumregs[6];
+// for (int i=6-registerCount; i < 6; ++i) {
+// int countless = 0;
+// for (int j=6-registerCount; j < i; ++j) {
+// if ( registers[j] < registers[i] )
+// ++countless;
+// }
+// renumregs[i] = registers[i] - countless -1;
+// }
+// uint32_t permutationEncoding = 0;
+// switch ( registerCount ) {
+// case 6:
+// permutationEncoding |= (120*renumregs[0] + 24*renumregs[1]
+// + 6*renumregs[2] + 2*renumregs[3]
+// + renumregs[4]);
+// break;
+// case 5:
+// permutationEncoding |= (120*renumregs[1] + 24*renumregs[2]
+// + 6*renumregs[3] + 2*renumregs[4]
+// + renumregs[5]);
+// break;
+// case 4:
+// permutationEncoding |= (60*renumregs[2] + 12*renumregs[3]
+// + 3*renumregs[4] + renumregs[5]);
+// break;
+// case 3:
+// permutationEncoding |= (20*renumregs[3] + 4*renumregs[4]
+// + renumregs[5]);
+// break;
+// case 2:
+// permutationEncoding |= (5*renumregs[4] + renumregs[5]);
+// break;
+// case 1:
+// permutationEncoding |= (renumregs[5]);
+// break;
+// }
+// return permutationEncoding;
+//}
+//
+
+
+
+
+//
+// x86_64
+//
+// 1-bit: start
+// 1-bit: has lsda
+// 2-bit: personality index
+//
// 4-bits: 0=old, 1=rbp based, 2=stack-imm, 3=stack-ind, 4=DWARF
-// rbp based:
-// 15-bits (5*3-bits per reg) register permutation
-// 8-bits for stack offset
-// frameless:
-// 8-bits stack size
-// 3-bits stack adjust
-// 3-bits register count
-// 10-bits register permutation
-//
-enum {
- UNWIND_X86_64_MODE_MASK = 0x0F000000,
- UNWIND_X86_64_MODE_RBP_FRAME = 0x01000000,
- UNWIND_X86_64_MODE_STACK_IMMD = 0x02000000,
- UNWIND_X86_64_MODE_STACK_IND = 0x03000000,
- UNWIND_X86_64_MODE_DWARF = 0x04000000,
-
- UNWIND_X86_64_RBP_FRAME_REGISTERS = 0x00007FFF,
- UNWIND_X86_64_RBP_FRAME_OFFSET = 0x00FF0000,
-
- UNWIND_X86_64_FRAMELESS_STACK_SIZE = 0x00FF0000,
- UNWIND_X86_64_FRAMELESS_STACK_ADJUST = 0x0000E000,
- UNWIND_X86_64_FRAMELESS_STACK_REG_COUNT = 0x00001C00,
- UNWIND_X86_64_FRAMELESS_STACK_REG_PERMUTATION = 0x000003FF,
-
- UNWIND_X86_64_DWARF_SECTION_OFFSET = 0x00FFFFFF,
-};
-
-enum {
- UNWIND_X86_64_REG_NONE = 0,
- UNWIND_X86_64_REG_RBX = 1,
- UNWIND_X86_64_REG_R12 = 2,
- UNWIND_X86_64_REG_R13 = 3,
- UNWIND_X86_64_REG_R14 = 4,
- UNWIND_X86_64_REG_R15 = 5,
- UNWIND_X86_64_REG_RBP = 6,
-};
-//
-// For x86_64 there are four modes for the compact unwind encoding:
-// UNWIND_X86_64_MODE_RBP_FRAME:
-// RBP based frame where RBP is push on stack immediately after return address,
-// then RSP is moved to RBP. Thus, to unwind RSP is restored with the current
-// EPB value, then RBP is restored by popping off the stack, and the return
-// is done by popping the stack once more into the pc.
-// All non-volatile registers that need to be restored must have been saved
-// in a small range in the stack that starts RBP-8 to RBP-2040. The offset/8
-// is encoded in the UNWIND_X86_64_RBP_FRAME_OFFSET bits. The registers saved
-// are encoded in the UNWIND_X86_64_RBP_FRAME_REGISTERS bits as five 3-bit entries.
-// Each entry contains which register to restore.
-// UNWIND_X86_64_MODE_STACK_IMMD:
-// A "frameless" (RBP not used as frame pointer) function with a small
-// constant stack size. To return, a constant (encoded in the compact
-// unwind encoding) is added to the RSP. Then the return is done by
-// popping the stack into the pc.
-// All non-volatile registers that need to be restored must have been saved
-// on the stack immediately after the return address. The stack_size/8 is
-// encoded in the UNWIND_X86_64_FRAMELESS_STACK_SIZE (max stack size is 2048).
-// The number of registers saved is encoded in UNWIND_X86_64_FRAMELESS_STACK_REG_COUNT.
-// UNWIND_X86_64_FRAMELESS_STACK_REG_PERMUTATION constains which registers were
-// saved and their order.
-// UNWIND_X86_64_MODE_STACK_IND:
-// A "frameless" (RBP not used as frame pointer) function large constant
-// stack size. This case is like the previous, except the stack size is too
-// large to encode in the compact unwind encoding. Instead it requires that
-// the function contains "subq $nnnnnnnn,RSP" in its prolog. The compact
-// encoding contains the offset to the nnnnnnnn value in the function in
-// UNWIND_X86_64_FRAMELESS_STACK_SIZE.
-// UNWIND_X86_64_MODE_DWARF:
-// No compact unwind encoding is available. Instead the low 24-bits of the
+// rbp based:
+// 15-bits (5*3-bits per reg) register permutation
+// 8-bits for stack offset
+// frameless:
+// 8-bits stack size
+// 3-bits stack adjust
+// 3-bits register count
+// 10-bits register permutation
+//
+enum {
+ UNWIND_X86_64_MODE_MASK = 0x0F000000,
+ UNWIND_X86_64_MODE_RBP_FRAME = 0x01000000,
+ UNWIND_X86_64_MODE_STACK_IMMD = 0x02000000,
+ UNWIND_X86_64_MODE_STACK_IND = 0x03000000,
+ UNWIND_X86_64_MODE_DWARF = 0x04000000,
+
+ UNWIND_X86_64_RBP_FRAME_REGISTERS = 0x00007FFF,
+ UNWIND_X86_64_RBP_FRAME_OFFSET = 0x00FF0000,
+
+ UNWIND_X86_64_FRAMELESS_STACK_SIZE = 0x00FF0000,
+ UNWIND_X86_64_FRAMELESS_STACK_ADJUST = 0x0000E000,
+ UNWIND_X86_64_FRAMELESS_STACK_REG_COUNT = 0x00001C00,
+ UNWIND_X86_64_FRAMELESS_STACK_REG_PERMUTATION = 0x000003FF,
+
+ UNWIND_X86_64_DWARF_SECTION_OFFSET = 0x00FFFFFF,
+};
+
+enum {
+ UNWIND_X86_64_REG_NONE = 0,
+ UNWIND_X86_64_REG_RBX = 1,
+ UNWIND_X86_64_REG_R12 = 2,
+ UNWIND_X86_64_REG_R13 = 3,
+ UNWIND_X86_64_REG_R14 = 4,
+ UNWIND_X86_64_REG_R15 = 5,
+ UNWIND_X86_64_REG_RBP = 6,
+};
+//
+// For x86_64 there are four modes for the compact unwind encoding:
+// UNWIND_X86_64_MODE_RBP_FRAME:
+// RBP based frame where RBP is push on stack immediately after return address,
+// then RSP is moved to RBP. Thus, to unwind RSP is restored with the current
+// EPB value, then RBP is restored by popping off the stack, and the return
+// is done by popping the stack once more into the pc.
+// All non-volatile registers that need to be restored must have been saved
+// in a small range in the stack that starts RBP-8 to RBP-2040. The offset/8
+// is encoded in the UNWIND_X86_64_RBP_FRAME_OFFSET bits. The registers saved
+// are encoded in the UNWIND_X86_64_RBP_FRAME_REGISTERS bits as five 3-bit entries.
+// Each entry contains which register to restore.
+// UNWIND_X86_64_MODE_STACK_IMMD:
+// A "frameless" (RBP not used as frame pointer) function with a small
+// constant stack size. To return, a constant (encoded in the compact
+// unwind encoding) is added to the RSP. Then the return is done by
+// popping the stack into the pc.
+// All non-volatile registers that need to be restored must have been saved
+// on the stack immediately after the return address. The stack_size/8 is
+// encoded in the UNWIND_X86_64_FRAMELESS_STACK_SIZE (max stack size is 2048).
+// The number of registers saved is encoded in UNWIND_X86_64_FRAMELESS_STACK_REG_COUNT.
+// UNWIND_X86_64_FRAMELESS_STACK_REG_PERMUTATION constains which registers were
+// saved and their order.
+// UNWIND_X86_64_MODE_STACK_IND:
+// A "frameless" (RBP not used as frame pointer) function large constant
+// stack size. This case is like the previous, except the stack size is too
+// large to encode in the compact unwind encoding. Instead it requires that
+// the function contains "subq $nnnnnnnn,RSP" in its prolog. The compact
+// encoding contains the offset to the nnnnnnnn value in the function in
+// UNWIND_X86_64_FRAMELESS_STACK_SIZE.
+// UNWIND_X86_64_MODE_DWARF:
+// No compact unwind encoding is available. Instead the low 24-bits of the
// compact encoding is the offset of the DWARF FDE in the __eh_frame section.
-// This mode is never used in object files. It is only generated by the
+// This mode is never used in object files. It is only generated by the
// linker in final linked images which have only DWARF unwind info for a
-// function.
-//
-
-
-// ARM64
-//
-// 1-bit: start
-// 1-bit: has lsda
-// 2-bit: personality index
-//
+// function.
+//
+
+
+// ARM64
+//
+// 1-bit: start
+// 1-bit: has lsda
+// 2-bit: personality index
+//
// 4-bits: 4=frame-based, 3=DWARF, 2=frameless
-// frameless:
-// 12-bits of stack size
-// frame-based:
-// 4-bits D reg pairs saved
-// 5-bits X reg pairs saved
+// frameless:
+// 12-bits of stack size
+// frame-based:
+// 4-bits D reg pairs saved
+// 5-bits X reg pairs saved
// DWARF:
// 24-bits offset of DWARF FDE in __eh_frame section
-//
-enum {
- UNWIND_ARM64_MODE_MASK = 0x0F000000,
- UNWIND_ARM64_MODE_FRAMELESS = 0x02000000,
- UNWIND_ARM64_MODE_DWARF = 0x03000000,
- UNWIND_ARM64_MODE_FRAME = 0x04000000,
-
- UNWIND_ARM64_FRAME_X19_X20_PAIR = 0x00000001,
- UNWIND_ARM64_FRAME_X21_X22_PAIR = 0x00000002,
- UNWIND_ARM64_FRAME_X23_X24_PAIR = 0x00000004,
- UNWIND_ARM64_FRAME_X25_X26_PAIR = 0x00000008,
- UNWIND_ARM64_FRAME_X27_X28_PAIR = 0x00000010,
- UNWIND_ARM64_FRAME_D8_D9_PAIR = 0x00000100,
- UNWIND_ARM64_FRAME_D10_D11_PAIR = 0x00000200,
- UNWIND_ARM64_FRAME_D12_D13_PAIR = 0x00000400,
- UNWIND_ARM64_FRAME_D14_D15_PAIR = 0x00000800,
-
- UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK = 0x00FFF000,
- UNWIND_ARM64_DWARF_SECTION_OFFSET = 0x00FFFFFF,
-};
-// For arm64 there are three modes for the compact unwind encoding:
-// UNWIND_ARM64_MODE_FRAME:
-// This is a standard arm64 prolog where FP/LR are immediately pushed on the
-// stack, then SP is copied to FP. If there are any non-volatile registers
-// saved, then are copied into the stack frame in pairs in a contiguous
-// range right below the saved FP/LR pair. Any subset of the five X pairs
-// and four D pairs can be saved, but the memory layout must be in register
-// number order.
-// UNWIND_ARM64_MODE_FRAMELESS:
-// A "frameless" leaf function, where FP/LR are not saved. The return address
-// remains in LR throughout the function. If any non-volatile registers
-// are saved, they must be pushed onto the stack before any stack space is
-// allocated for local variables. The stack sized (including any saved
-// non-volatile registers) divided by 16 is encoded in the bits
-// UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK.
-// UNWIND_ARM64_MODE_DWARF:
-// No compact unwind encoding is available. Instead the low 24-bits of the
+//
+enum {
+ UNWIND_ARM64_MODE_MASK = 0x0F000000,
+ UNWIND_ARM64_MODE_FRAMELESS = 0x02000000,
+ UNWIND_ARM64_MODE_DWARF = 0x03000000,
+ UNWIND_ARM64_MODE_FRAME = 0x04000000,
+
+ UNWIND_ARM64_FRAME_X19_X20_PAIR = 0x00000001,
+ UNWIND_ARM64_FRAME_X21_X22_PAIR = 0x00000002,
+ UNWIND_ARM64_FRAME_X23_X24_PAIR = 0x00000004,
+ UNWIND_ARM64_FRAME_X25_X26_PAIR = 0x00000008,
+ UNWIND_ARM64_FRAME_X27_X28_PAIR = 0x00000010,
+ UNWIND_ARM64_FRAME_D8_D9_PAIR = 0x00000100,
+ UNWIND_ARM64_FRAME_D10_D11_PAIR = 0x00000200,
+ UNWIND_ARM64_FRAME_D12_D13_PAIR = 0x00000400,
+ UNWIND_ARM64_FRAME_D14_D15_PAIR = 0x00000800,
+
+ UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK = 0x00FFF000,
+ UNWIND_ARM64_DWARF_SECTION_OFFSET = 0x00FFFFFF,
+};
+// For arm64 there are three modes for the compact unwind encoding:
+// UNWIND_ARM64_MODE_FRAME:
+// This is a standard arm64 prolog where FP/LR are immediately pushed on the
+// stack, then SP is copied to FP. If there are any non-volatile registers
+// saved, then are copied into the stack frame in pairs in a contiguous
+// range right below the saved FP/LR pair. Any subset of the five X pairs
+// and four D pairs can be saved, but the memory layout must be in register
+// number order.
+// UNWIND_ARM64_MODE_FRAMELESS:
+// A "frameless" leaf function, where FP/LR are not saved. The return address
+// remains in LR throughout the function. If any non-volatile registers
+// are saved, they must be pushed onto the stack before any stack space is
+// allocated for local variables. The stack sized (including any saved
+// non-volatile registers) divided by 16 is encoded in the bits
+// UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK.
+// UNWIND_ARM64_MODE_DWARF:
+// No compact unwind encoding is available. Instead the low 24-bits of the
// compact encoding is the offset of the DWARF FDE in the __eh_frame section.
-// This mode is never used in object files. It is only generated by the
+// This mode is never used in object files. It is only generated by the
// linker in final linked images which have only DWARF unwind info for a
-// function.
-//
-
-
-
-
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// Relocatable Object Files: __LD,__compact_unwind
-//
-////////////////////////////////////////////////////////////////////////////////
-
-//
-// A compiler can generated compact unwind information for a function by adding
-// a "row" to the __LD,__compact_unwind section. This section has the
-// S_ATTR_DEBUG bit set, so the section will be ignored by older linkers.
-// It is removed by the new linker, so never ends up in final executables.
-// This section is a table, initially with one row per function (that needs
-// unwind info). The table columns and some conceptual entries are:
-//
-// range-start pointer to start of function/range
-// range-length
-// compact-unwind-encoding 32-bit encoding
-// personality-function or zero if no personality function
-// lsda or zero if no LSDA data
-//
-// The length and encoding fields are 32-bits. The other are all pointer sized.
-//
-// In x86_64 assembly, these entry would look like:
-//
-// .section __LD,__compact_unwind,regular,debug
-//
-// #compact unwind for _foo
-// .quad _foo
-// .set L1,LfooEnd-_foo
-// .long L1
-// .long 0x01010001
-// .quad 0
-// .quad 0
-//
-// #compact unwind for _bar
-// .quad _bar
-// .set L2,LbarEnd-_bar
-// .long L2
-// .long 0x01020011
-// .quad __gxx_personality
-// .quad except_tab1
-//
-//
-// Notes: There is no need for any labels in the the __compact_unwind section.
-// The use of the .set directive is to force the evaluation of the
-// range-length at assembly time, instead of generating relocations.
-//
-// To support future compiler optimizations where which non-volatile registers
-// are saved changes within a function (e.g. delay saving non-volatiles until
-// necessary), there can by multiple lines in the __compact_unwind table for one
-// function, each with a different (non-overlapping) range and each with
-// different compact unwind encodings that correspond to the non-volatiles
-// saved at that range of the function.
-//
-// If a particular function is so wacky that there is no compact unwind way
+// function.
+//
+
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Relocatable Object Files: __LD,__compact_unwind
+//
+////////////////////////////////////////////////////////////////////////////////
+
+//
+// A compiler can generated compact unwind information for a function by adding
+// a "row" to the __LD,__compact_unwind section. This section has the
+// S_ATTR_DEBUG bit set, so the section will be ignored by older linkers.
+// It is removed by the new linker, so never ends up in final executables.
+// This section is a table, initially with one row per function (that needs
+// unwind info). The table columns and some conceptual entries are:
+//
+// range-start pointer to start of function/range
+// range-length
+// compact-unwind-encoding 32-bit encoding
+// personality-function or zero if no personality function
+// lsda or zero if no LSDA data
+//
+// The length and encoding fields are 32-bits. The other are all pointer sized.
+//
+// In x86_64 assembly, these entry would look like:
+//
+// .section __LD,__compact_unwind,regular,debug
+//
+// #compact unwind for _foo
+// .quad _foo
+// .set L1,LfooEnd-_foo
+// .long L1
+// .long 0x01010001
+// .quad 0
+// .quad 0
+//
+// #compact unwind for _bar
+// .quad _bar
+// .set L2,LbarEnd-_bar
+// .long L2
+// .long 0x01020011
+// .quad __gxx_personality
+// .quad except_tab1
+//
+//
+// Notes: There is no need for any labels in the the __compact_unwind section.
+// The use of the .set directive is to force the evaluation of the
+// range-length at assembly time, instead of generating relocations.
+//
+// To support future compiler optimizations where which non-volatile registers
+// are saved changes within a function (e.g. delay saving non-volatiles until
+// necessary), there can by multiple lines in the __compact_unwind table for one
+// function, each with a different (non-overlapping) range and each with
+// different compact unwind encodings that correspond to the non-volatiles
+// saved at that range of the function.
+//
+// If a particular function is so wacky that there is no compact unwind way
// to encode it, then the compiler can emit traditional DWARF unwind info.
-// The runtime will use which ever is available.
-//
-// Runtime support for compact unwind encodings are only available on 10.6
-// and later. So, the compiler should not generate it when targeting pre-10.6.
-
-
-
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// Final Linked Images: __TEXT,__unwind_info
-//
-////////////////////////////////////////////////////////////////////////////////
-
-//
-// The __TEXT,__unwind_info section is laid out for an efficient two level lookup.
-// The header of the section contains a coarse index that maps function address
-// to the page (4096 byte block) containing the unwind info for that function.
-//
-
-#define UNWIND_SECTION_VERSION 1
-struct unwind_info_section_header
-{
- uint32_t version; // UNWIND_SECTION_VERSION
- uint32_t commonEncodingsArraySectionOffset;
- uint32_t commonEncodingsArrayCount;
- uint32_t personalityArraySectionOffset;
- uint32_t personalityArrayCount;
- uint32_t indexSectionOffset;
- uint32_t indexCount;
- // compact_unwind_encoding_t[]
- // uint32_t personalities[]
- // unwind_info_section_header_index_entry[]
- // unwind_info_section_header_lsda_index_entry[]
-};
-
-struct unwind_info_section_header_index_entry
-{
- uint32_t functionOffset;
- uint32_t secondLevelPagesSectionOffset; // section offset to start of regular or compress page
- uint32_t lsdaIndexArraySectionOffset; // section offset to start of lsda_index array for this range
-};
-
-struct unwind_info_section_header_lsda_index_entry
-{
- uint32_t functionOffset;
- uint32_t lsdaOffset;
-};
-
-//
-// There are two kinds of second level index pages: regular and compressed.
-// A compressed page can hold up to 1021 entries, but it cannot be used
-// if too many different encoding types are used. The regular page holds
-// 511 entries.
-//
-
-struct unwind_info_regular_second_level_entry
-{
- uint32_t functionOffset;
- compact_unwind_encoding_t encoding;
-};
-
-#define UNWIND_SECOND_LEVEL_REGULAR 2
-struct unwind_info_regular_second_level_page_header
-{
- uint32_t kind; // UNWIND_SECOND_LEVEL_REGULAR
- uint16_t entryPageOffset;
- uint16_t entryCount;
- // entry array
-};
-
-#define UNWIND_SECOND_LEVEL_COMPRESSED 3
-struct unwind_info_compressed_second_level_page_header
-{
- uint32_t kind; // UNWIND_SECOND_LEVEL_COMPRESSED
- uint16_t entryPageOffset;
- uint16_t entryCount;
- uint16_t encodingsPageOffset;
- uint16_t encodingsCount;
- // 32-bit entry array
- // encodings array
-};
-
-#define UNWIND_INFO_COMPRESSED_ENTRY_FUNC_OFFSET(entry) (entry & 0x00FFFFFF)
-#define UNWIND_INFO_COMPRESSED_ENTRY_ENCODING_INDEX(entry) ((entry >> 24) & 0xFF)
-
-
-
-#endif
-
+// The runtime will use which ever is available.
+//
+// Runtime support for compact unwind encodings are only available on 10.6
+// and later. So, the compiler should not generate it when targeting pre-10.6.
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Final Linked Images: __TEXT,__unwind_info
+//
+////////////////////////////////////////////////////////////////////////////////
+
+//
+// The __TEXT,__unwind_info section is laid out for an efficient two level lookup.
+// The header of the section contains a coarse index that maps function address
+// to the page (4096 byte block) containing the unwind info for that function.
+//
+
+#define UNWIND_SECTION_VERSION 1
+struct unwind_info_section_header
+{
+ uint32_t version; // UNWIND_SECTION_VERSION
+ uint32_t commonEncodingsArraySectionOffset;
+ uint32_t commonEncodingsArrayCount;
+ uint32_t personalityArraySectionOffset;
+ uint32_t personalityArrayCount;
+ uint32_t indexSectionOffset;
+ uint32_t indexCount;
+ // compact_unwind_encoding_t[]
+ // uint32_t personalities[]
+ // unwind_info_section_header_index_entry[]
+ // unwind_info_section_header_lsda_index_entry[]
+};
+
+struct unwind_info_section_header_index_entry
+{
+ uint32_t functionOffset;
+ uint32_t secondLevelPagesSectionOffset; // section offset to start of regular or compress page
+ uint32_t lsdaIndexArraySectionOffset; // section offset to start of lsda_index array for this range
+};
+
+struct unwind_info_section_header_lsda_index_entry
+{
+ uint32_t functionOffset;
+ uint32_t lsdaOffset;
+};
+
+//
+// There are two kinds of second level index pages: regular and compressed.
+// A compressed page can hold up to 1021 entries, but it cannot be used
+// if too many different encoding types are used. The regular page holds
+// 511 entries.
+//
+
+struct unwind_info_regular_second_level_entry
+{
+ uint32_t functionOffset;
+ compact_unwind_encoding_t encoding;
+};
+
+#define UNWIND_SECOND_LEVEL_REGULAR 2
+struct unwind_info_regular_second_level_page_header
+{
+ uint32_t kind; // UNWIND_SECOND_LEVEL_REGULAR
+ uint16_t entryPageOffset;
+ uint16_t entryCount;
+ // entry array
+};
+
+#define UNWIND_SECOND_LEVEL_COMPRESSED 3
+struct unwind_info_compressed_second_level_page_header
+{
+ uint32_t kind; // UNWIND_SECOND_LEVEL_COMPRESSED
+ uint16_t entryPageOffset;
+ uint16_t entryCount;
+ uint16_t encodingsPageOffset;
+ uint16_t encodingsCount;
+ // 32-bit entry array
+ // encodings array
+};
+
+#define UNWIND_INFO_COMPRESSED_ENTRY_FUNC_OFFSET(entry) (entry & 0x00FFFFFF)
+#define UNWIND_INFO_COMPRESSED_ENTRY_ENCODING_INDEX(entry) ((entry >> 24) & 0xFF)
+
+
+
+#endif
+
diff --git a/contrib/libs/libunwind/include/unwind.h b/contrib/libs/libunwind/include/unwind.h
index 13ff2b6bf8..6949e063dd 100644
--- a/contrib/libs/libunwind/include/unwind.h
+++ b/contrib/libs/libunwind/include/unwind.h
@@ -1,190 +1,190 @@
//===----------------------------------------------------------------------===//
-//
+//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//
-// C++ ABI Level 1 ABI documented at:
+//
+//
+// C++ ABI Level 1 ABI documented at:
// https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef __UNWIND_H__
-#define __UNWIND_H__
-
-#include "__libunwind_config.h"
-
-#include <stdint.h>
-#include <stddef.h>
-
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef __UNWIND_H__
+#define __UNWIND_H__
+
+#include "__libunwind_config.h"
+
+#include <stdint.h>
+#include <stddef.h>
+
#if defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__) && defined(_WIN32)
#include <windows.h>
#include <ntverp.h>
#endif
-#if defined(__APPLE__)
-#define LIBUNWIND_UNAVAIL __attribute__ (( deprecated ))
-#else
-#define LIBUNWIND_UNAVAIL
-#endif
-
-typedef enum {
- _URC_NO_REASON = 0,
- _URC_OK = 0,
- _URC_FOREIGN_EXCEPTION_CAUGHT = 1,
- _URC_FATAL_PHASE2_ERROR = 2,
- _URC_FATAL_PHASE1_ERROR = 3,
- _URC_NORMAL_STOP = 4,
- _URC_END_OF_STACK = 5,
- _URC_HANDLER_FOUND = 6,
- _URC_INSTALL_CONTEXT = 7,
- _URC_CONTINUE_UNWIND = 8,
+#if defined(__APPLE__)
+#define LIBUNWIND_UNAVAIL __attribute__ (( deprecated ))
+#else
+#define LIBUNWIND_UNAVAIL
+#endif
+
+typedef enum {
+ _URC_NO_REASON = 0,
+ _URC_OK = 0,
+ _URC_FOREIGN_EXCEPTION_CAUGHT = 1,
+ _URC_FATAL_PHASE2_ERROR = 2,
+ _URC_FATAL_PHASE1_ERROR = 3,
+ _URC_NORMAL_STOP = 4,
+ _URC_END_OF_STACK = 5,
+ _URC_HANDLER_FOUND = 6,
+ _URC_INSTALL_CONTEXT = 7,
+ _URC_CONTINUE_UNWIND = 8,
#if defined(_LIBUNWIND_ARM_EHABI)
- _URC_FAILURE = 9
-#endif
-} _Unwind_Reason_Code;
-
-typedef enum {
- _UA_SEARCH_PHASE = 1,
- _UA_CLEANUP_PHASE = 2,
- _UA_HANDLER_FRAME = 4,
- _UA_FORCE_UNWIND = 8,
- _UA_END_OF_STACK = 16 // gcc extension to C++ ABI
-} _Unwind_Action;
-
-typedef struct _Unwind_Context _Unwind_Context; // opaque
-
+ _URC_FAILURE = 9
+#endif
+} _Unwind_Reason_Code;
+
+typedef enum {
+ _UA_SEARCH_PHASE = 1,
+ _UA_CLEANUP_PHASE = 2,
+ _UA_HANDLER_FRAME = 4,
+ _UA_FORCE_UNWIND = 8,
+ _UA_END_OF_STACK = 16 // gcc extension to C++ ABI
+} _Unwind_Action;
+
+typedef struct _Unwind_Context _Unwind_Context; // opaque
+
#if defined(_LIBUNWIND_ARM_EHABI)
#include "unwind_arm_ehabi.h"
#else
#include "unwind_itanium.h"
#endif
-
-typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)
- (int version,
- _Unwind_Action actions,
+
+typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)
+ (int version,
+ _Unwind_Action actions,
_Unwind_Exception_Class exceptionClass,
- _Unwind_Exception* exceptionObject,
- struct _Unwind_Context* context,
+ _Unwind_Exception* exceptionObject,
+ struct _Unwind_Context* context,
void* stop_parameter);
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern uintptr_t _Unwind_GetRegionStart(struct _Unwind_Context *context);
-extern uintptr_t
- _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context);
-#ifdef __USING_SJLJ_EXCEPTIONS__
-extern _Unwind_Reason_Code
- _Unwind_SjLj_ForcedUnwind(_Unwind_Exception *exception_object,
- _Unwind_Stop_Fn stop, void *stop_parameter);
-#else
-extern _Unwind_Reason_Code
- _Unwind_ForcedUnwind(_Unwind_Exception *exception_object,
- _Unwind_Stop_Fn stop, void *stop_parameter);
-#endif
-
-#ifdef __USING_SJLJ_EXCEPTIONS__
-typedef struct _Unwind_FunctionContext *_Unwind_FunctionContext_t;
-extern void _Unwind_SjLj_Register(_Unwind_FunctionContext_t fc);
-extern void _Unwind_SjLj_Unregister(_Unwind_FunctionContext_t fc);
-#endif
-
-//
-// The following are semi-suppoted extensions to the C++ ABI
-//
-
-//
-// called by __cxa_rethrow().
-//
-#ifdef __USING_SJLJ_EXCEPTIONS__
-extern _Unwind_Reason_Code
- _Unwind_SjLj_Resume_or_Rethrow(_Unwind_Exception *exception_object);
-#else
-extern _Unwind_Reason_Code
- _Unwind_Resume_or_Rethrow(_Unwind_Exception *exception_object);
-#endif
-
-// _Unwind_Backtrace() is a gcc extension that walks the stack and calls the
-// _Unwind_Trace_Fn once per frame until it reaches the bottom of the stack
-// or the _Unwind_Trace_Fn function returns something other than _URC_NO_REASON.
-typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn)(struct _Unwind_Context *,
- void *);
-extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *);
-
-// _Unwind_GetCFA is a gcc extension that can be called from within a
-// personality handler to get the CFA (stack pointer before call) of
-// current frame.
-extern uintptr_t _Unwind_GetCFA(struct _Unwind_Context *);
-
-
-// _Unwind_GetIPInfo is a gcc extension that can be called from within a
-// personality handler. Similar to _Unwind_GetIP() but also returns in
-// *ipBefore a non-zero value if the instruction pointer is at or before the
-// instruction causing the unwind. Normally, in a function call, the IP returned
-// is the return address which is after the call instruction and may be past the
-// end of the function containing the call instruction.
-extern uintptr_t _Unwind_GetIPInfo(struct _Unwind_Context *context,
- int *ipBefore);
-
-
-// __register_frame() is used with dynamically generated code to register the
-// FDE for a generated (JIT) code. The FDE must use pc-rel addressing to point
-// to its function and optional LSDA.
-// __register_frame() has existed in all versions of Mac OS X, but in 10.4 and
-// 10.5 it was buggy and did not actually register the FDE with the unwinder.
-// In 10.6 and later it does register properly.
-extern void __register_frame(const void *fde);
-extern void __deregister_frame(const void *fde);
-
-// _Unwind_Find_FDE() will locate the FDE if the pc is in some function that has
-// an associated FDE. Note, Mac OS X 10.6 and later, introduces "compact unwind
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern uintptr_t _Unwind_GetRegionStart(struct _Unwind_Context *context);
+extern uintptr_t
+ _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context);
+#ifdef __USING_SJLJ_EXCEPTIONS__
+extern _Unwind_Reason_Code
+ _Unwind_SjLj_ForcedUnwind(_Unwind_Exception *exception_object,
+ _Unwind_Stop_Fn stop, void *stop_parameter);
+#else
+extern _Unwind_Reason_Code
+ _Unwind_ForcedUnwind(_Unwind_Exception *exception_object,
+ _Unwind_Stop_Fn stop, void *stop_parameter);
+#endif
+
+#ifdef __USING_SJLJ_EXCEPTIONS__
+typedef struct _Unwind_FunctionContext *_Unwind_FunctionContext_t;
+extern void _Unwind_SjLj_Register(_Unwind_FunctionContext_t fc);
+extern void _Unwind_SjLj_Unregister(_Unwind_FunctionContext_t fc);
+#endif
+
+//
+// The following are semi-suppoted extensions to the C++ ABI
+//
+
+//
+// called by __cxa_rethrow().
+//
+#ifdef __USING_SJLJ_EXCEPTIONS__
+extern _Unwind_Reason_Code
+ _Unwind_SjLj_Resume_or_Rethrow(_Unwind_Exception *exception_object);
+#else
+extern _Unwind_Reason_Code
+ _Unwind_Resume_or_Rethrow(_Unwind_Exception *exception_object);
+#endif
+
+// _Unwind_Backtrace() is a gcc extension that walks the stack and calls the
+// _Unwind_Trace_Fn once per frame until it reaches the bottom of the stack
+// or the _Unwind_Trace_Fn function returns something other than _URC_NO_REASON.
+typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn)(struct _Unwind_Context *,
+ void *);
+extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *);
+
+// _Unwind_GetCFA is a gcc extension that can be called from within a
+// personality handler to get the CFA (stack pointer before call) of
+// current frame.
+extern uintptr_t _Unwind_GetCFA(struct _Unwind_Context *);
+
+
+// _Unwind_GetIPInfo is a gcc extension that can be called from within a
+// personality handler. Similar to _Unwind_GetIP() but also returns in
+// *ipBefore a non-zero value if the instruction pointer is at or before the
+// instruction causing the unwind. Normally, in a function call, the IP returned
+// is the return address which is after the call instruction and may be past the
+// end of the function containing the call instruction.
+extern uintptr_t _Unwind_GetIPInfo(struct _Unwind_Context *context,
+ int *ipBefore);
+
+
+// __register_frame() is used with dynamically generated code to register the
+// FDE for a generated (JIT) code. The FDE must use pc-rel addressing to point
+// to its function and optional LSDA.
+// __register_frame() has existed in all versions of Mac OS X, but in 10.4 and
+// 10.5 it was buggy and did not actually register the FDE with the unwinder.
+// In 10.6 and later it does register properly.
+extern void __register_frame(const void *fde);
+extern void __deregister_frame(const void *fde);
+
+// _Unwind_Find_FDE() will locate the FDE if the pc is in some function that has
+// an associated FDE. Note, Mac OS X 10.6 and later, introduces "compact unwind
// info" which the runtime uses in preference to DWARF unwind info. This
-// function will only work if the target function has an FDE but no compact
-// unwind info.
-struct dwarf_eh_bases {
- uintptr_t tbase;
- uintptr_t dbase;
- uintptr_t func;
-};
-extern const void *_Unwind_Find_FDE(const void *pc, struct dwarf_eh_bases *);
-
-
-// This function attempts to find the start (address of first instruction) of
-// a function given an address inside the function. It only works if the
+// function will only work if the target function has an FDE but no compact
+// unwind info.
+struct dwarf_eh_bases {
+ uintptr_t tbase;
+ uintptr_t dbase;
+ uintptr_t func;
+};
+extern const void *_Unwind_Find_FDE(const void *pc, struct dwarf_eh_bases *);
+
+
+// This function attempts to find the start (address of first instruction) of
+// a function given an address inside the function. It only works if the
// function has an FDE (DWARF unwind info).
-// This function is unimplemented on Mac OS X 10.6 and later. Instead, use
-// _Unwind_Find_FDE() and look at the dwarf_eh_bases.func result.
-extern void *_Unwind_FindEnclosingFunction(void *pc);
-
-// Mac OS X does not support text-rel and data-rel addressing so these functions
-// are unimplemented
-extern uintptr_t _Unwind_GetDataRelBase(struct _Unwind_Context *context)
- LIBUNWIND_UNAVAIL;
-extern uintptr_t _Unwind_GetTextRelBase(struct _Unwind_Context *context)
- LIBUNWIND_UNAVAIL;
-
-// Mac OS X 10.4 and 10.5 had implementations of these functions in
-// libgcc_s.dylib, but they never worked.
-/// These functions are no longer available on Mac OS X.
-extern void __register_frame_info_bases(const void *fde, void *ob, void *tb,
- void *db) LIBUNWIND_UNAVAIL;
-extern void __register_frame_info(const void *fde, void *ob)
- LIBUNWIND_UNAVAIL;
-extern void __register_frame_info_table_bases(const void *fde, void *ob,
- void *tb, void *db)
- LIBUNWIND_UNAVAIL;
-extern void __register_frame_info_table(const void *fde, void *ob)
- LIBUNWIND_UNAVAIL;
-extern void __register_frame_table(const void *fde)
- LIBUNWIND_UNAVAIL;
-extern void *__deregister_frame_info(const void *fde)
- LIBUNWIND_UNAVAIL;
-extern void *__deregister_frame_info_bases(const void *fde)
- LIBUNWIND_UNAVAIL;
-
+// This function is unimplemented on Mac OS X 10.6 and later. Instead, use
+// _Unwind_Find_FDE() and look at the dwarf_eh_bases.func result.
+extern void *_Unwind_FindEnclosingFunction(void *pc);
+
+// Mac OS X does not support text-rel and data-rel addressing so these functions
+// are unimplemented
+extern uintptr_t _Unwind_GetDataRelBase(struct _Unwind_Context *context)
+ LIBUNWIND_UNAVAIL;
+extern uintptr_t _Unwind_GetTextRelBase(struct _Unwind_Context *context)
+ LIBUNWIND_UNAVAIL;
+
+// Mac OS X 10.4 and 10.5 had implementations of these functions in
+// libgcc_s.dylib, but they never worked.
+/// These functions are no longer available on Mac OS X.
+extern void __register_frame_info_bases(const void *fde, void *ob, void *tb,
+ void *db) LIBUNWIND_UNAVAIL;
+extern void __register_frame_info(const void *fde, void *ob)
+ LIBUNWIND_UNAVAIL;
+extern void __register_frame_info_table_bases(const void *fde, void *ob,
+ void *tb, void *db)
+ LIBUNWIND_UNAVAIL;
+extern void __register_frame_info_table(const void *fde, void *ob)
+ LIBUNWIND_UNAVAIL;
+extern void __register_frame_table(const void *fde)
+ LIBUNWIND_UNAVAIL;
+extern void *__deregister_frame_info(const void *fde)
+ LIBUNWIND_UNAVAIL;
+extern void *__deregister_frame_info_bases(const void *fde)
+ LIBUNWIND_UNAVAIL;
+
#if defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__)
#ifndef _WIN32
typedef struct _EXCEPTION_RECORD EXCEPTION_RECORD;
@@ -215,8 +215,8 @@ typedef struct _Unwind_Backtrace_Buffer {
void* backtrace[_YNDX_LIBUNWIND_EXCEPTION_BACKTRACE_SIZE];
} _Unwind_Backtrace_Buffer;
#endif
-#ifdef __cplusplus
-}
-#endif
-
-#endif // __UNWIND_H__
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __UNWIND_H__
diff --git a/contrib/libs/libunwind/include/unwind_arm_ehabi.h b/contrib/libs/libunwind/include/unwind_arm_ehabi.h
index 178834a241..6277a1457f 100644
--- a/contrib/libs/libunwind/include/unwind_arm_ehabi.h
+++ b/contrib/libs/libunwind/include/unwind_arm_ehabi.h
@@ -1,170 +1,170 @@
//===----------------------------------------------------------------------===//
-//
+//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//
-// C++ ABI Level 1 ABI documented at:
+//
+//
+// C++ ABI Level 1 ABI documented at:
// https://github.com/ARM-software/abi-aa/blob/main/ehabi32/ehabi32.rst
-//
-//===----------------------------------------------------------------------===//
-
+//
+//===----------------------------------------------------------------------===//
+
#ifndef __ARM_EHABI_UNWIND_H__
#define __ARM_EHABI_UNWIND_H__
-
-typedef uint32_t _Unwind_State;
-
-static const _Unwind_State _US_VIRTUAL_UNWIND_FRAME = 0;
-static const _Unwind_State _US_UNWIND_FRAME_STARTING = 1;
-static const _Unwind_State _US_UNWIND_FRAME_RESUME = 2;
+
+typedef uint32_t _Unwind_State;
+
+static const _Unwind_State _US_VIRTUAL_UNWIND_FRAME = 0;
+static const _Unwind_State _US_UNWIND_FRAME_STARTING = 1;
+static const _Unwind_State _US_UNWIND_FRAME_RESUME = 2;
static const _Unwind_State _US_ACTION_MASK = 3;
-/* Undocumented flag for force unwinding. */
-static const _Unwind_State _US_FORCE_UNWIND = 8;
-
-typedef uint32_t _Unwind_EHT_Header;
-
-struct _Unwind_Control_Block;
-typedef struct _Unwind_Control_Block _Unwind_Control_Block;
+/* Undocumented flag for force unwinding. */
+static const _Unwind_State _US_FORCE_UNWIND = 8;
+
+typedef uint32_t _Unwind_EHT_Header;
+
+struct _Unwind_Control_Block;
+typedef struct _Unwind_Control_Block _Unwind_Control_Block;
#define _Unwind_Exception _Unwind_Control_Block /* Alias */
typedef uint8_t _Unwind_Exception_Class[8];
-
-struct _Unwind_Control_Block {
+
+struct _Unwind_Control_Block {
_Unwind_Exception_Class exception_class;
- void (*exception_cleanup)(_Unwind_Reason_Code, _Unwind_Control_Block*);
-
- /* Unwinder cache, private fields for the unwinder's use */
- struct {
- uint32_t reserved1; /* init reserved1 to 0, then don't touch */
- uint32_t reserved2;
- uint32_t reserved3;
- uint32_t reserved4;
- uint32_t reserved5;
- } unwinder_cache;
-
- /* Propagation barrier cache (valid after phase 1): */
- struct {
- uint32_t sp;
- uint32_t bitpattern[5];
- } barrier_cache;
-
- /* Cleanup cache (preserved over cleanup): */
- struct {
- uint32_t bitpattern[4];
- } cleanup_cache;
-
- /* Pr cache (for pr's benefit): */
- struct {
- uint32_t fnstart; /* function start address */
- _Unwind_EHT_Header* ehtp; /* pointer to EHT entry header word */
- uint32_t additional;
- uint32_t reserved1;
- } pr_cache;
-
- long long int :0; /* Enforce the 8-byte alignment */
+ void (*exception_cleanup)(_Unwind_Reason_Code, _Unwind_Control_Block*);
+
+ /* Unwinder cache, private fields for the unwinder's use */
+ struct {
+ uint32_t reserved1; /* init reserved1 to 0, then don't touch */
+ uint32_t reserved2;
+ uint32_t reserved3;
+ uint32_t reserved4;
+ uint32_t reserved5;
+ } unwinder_cache;
+
+ /* Propagation barrier cache (valid after phase 1): */
+ struct {
+ uint32_t sp;
+ uint32_t bitpattern[5];
+ } barrier_cache;
+
+ /* Cleanup cache (preserved over cleanup): */
+ struct {
+ uint32_t bitpattern[4];
+ } cleanup_cache;
+
+ /* Pr cache (for pr's benefit): */
+ struct {
+ uint32_t fnstart; /* function start address */
+ _Unwind_EHT_Header* ehtp; /* pointer to EHT entry header word */
+ uint32_t additional;
+ uint32_t reserved1;
+ } pr_cache;
+
+ long long int :0; /* Enforce the 8-byte alignment */
} __attribute__((__aligned__(8)));
-
+
typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn)(
_Unwind_State state, _Unwind_Exception *exceptionObject,
struct _Unwind_Context *context);
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-//
-// The following are the base functions documented by the C++ ABI
-//
-#ifdef __USING_SJLJ_EXCEPTIONS__
-extern _Unwind_Reason_Code
- _Unwind_SjLj_RaiseException(_Unwind_Exception *exception_object);
-extern void _Unwind_SjLj_Resume(_Unwind_Exception *exception_object);
-#else
-extern _Unwind_Reason_Code
- _Unwind_RaiseException(_Unwind_Exception *exception_object);
-extern void _Unwind_Resume(_Unwind_Exception *exception_object);
-#endif
-extern void _Unwind_DeleteException(_Unwind_Exception *exception_object);
-
-typedef enum {
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//
+// The following are the base functions documented by the C++ ABI
+//
+#ifdef __USING_SJLJ_EXCEPTIONS__
+extern _Unwind_Reason_Code
+ _Unwind_SjLj_RaiseException(_Unwind_Exception *exception_object);
+extern void _Unwind_SjLj_Resume(_Unwind_Exception *exception_object);
+#else
+extern _Unwind_Reason_Code
+ _Unwind_RaiseException(_Unwind_Exception *exception_object);
+extern void _Unwind_Resume(_Unwind_Exception *exception_object);
+#endif
+extern void _Unwind_DeleteException(_Unwind_Exception *exception_object);
+
+typedef enum {
_UVRSC_CORE = 0, /* integer register */
_UVRSC_VFP = 1, /* vfp */
- _UVRSC_WMMXD = 3, /* Intel WMMX data register */
+ _UVRSC_WMMXD = 3, /* Intel WMMX data register */
_UVRSC_WMMXC = 4, /* Intel WMMX control register */
_UVRSC_PSEUDO = 5 /* Special purpose pseudo register */
-} _Unwind_VRS_RegClass;
-
-typedef enum {
- _UVRSD_UINT32 = 0,
- _UVRSD_VFPX = 1,
- _UVRSD_UINT64 = 3,
- _UVRSD_FLOAT = 4,
- _UVRSD_DOUBLE = 5
-} _Unwind_VRS_DataRepresentation;
-
-typedef enum {
- _UVRSR_OK = 0,
- _UVRSR_NOT_IMPLEMENTED = 1,
- _UVRSR_FAILED = 2
-} _Unwind_VRS_Result;
-
-extern void _Unwind_Complete(_Unwind_Exception* exception_object);
-
-extern _Unwind_VRS_Result
-_Unwind_VRS_Get(_Unwind_Context *context, _Unwind_VRS_RegClass regclass,
- uint32_t regno, _Unwind_VRS_DataRepresentation representation,
- void *valuep);
-
-extern _Unwind_VRS_Result
-_Unwind_VRS_Set(_Unwind_Context *context, _Unwind_VRS_RegClass regclass,
- uint32_t regno, _Unwind_VRS_DataRepresentation representation,
- void *valuep);
-
-extern _Unwind_VRS_Result
-_Unwind_VRS_Pop(_Unwind_Context *context, _Unwind_VRS_RegClass regclass,
- uint32_t discriminator,
- _Unwind_VRS_DataRepresentation representation);
-
-#if defined(_LIBUNWIND_UNWIND_LEVEL1_EXTERNAL_LINKAGE)
-#define _LIBUNWIND_EXPORT_UNWIND_LEVEL1 extern
-#else
-#define _LIBUNWIND_EXPORT_UNWIND_LEVEL1 static __inline__
-#endif
-
-// These are de facto helper functions for ARM, which delegate the function
-// calls to _Unwind_VRS_Get/Set(). These are not a part of ARM EHABI
-// specification, thus these function MUST be inlined. Please don't replace
-// these with the "extern" function declaration; otherwise, the program
-// including this <unwind.h> header won't be ABI compatible and will result in
-// link error when we are linking the program with libgcc.
-
-_LIBUNWIND_EXPORT_UNWIND_LEVEL1
-uintptr_t _Unwind_GetGR(struct _Unwind_Context *context, int index) {
- uintptr_t value = 0;
- _Unwind_VRS_Get(context, _UVRSC_CORE, (uint32_t)index, _UVRSD_UINT32, &value);
- return value;
-}
-
-_LIBUNWIND_EXPORT_UNWIND_LEVEL1
-void _Unwind_SetGR(struct _Unwind_Context *context, int index,
- uintptr_t value) {
- _Unwind_VRS_Set(context, _UVRSC_CORE, (uint32_t)index, _UVRSD_UINT32, &value);
-}
-
-_LIBUNWIND_EXPORT_UNWIND_LEVEL1
-uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) {
- // remove the thumb-bit before returning
- return _Unwind_GetGR(context, 15) & (~(uintptr_t)0x1);
-}
-
-_LIBUNWIND_EXPORT_UNWIND_LEVEL1
-void _Unwind_SetIP(struct _Unwind_Context *context, uintptr_t value) {
- uintptr_t thumb_bit = _Unwind_GetGR(context, 15) & ((uintptr_t)0x1);
- _Unwind_SetGR(context, 15, value | thumb_bit);
-}
-
-#ifdef __cplusplus
-}
-#endif
-
+} _Unwind_VRS_RegClass;
+
+typedef enum {
+ _UVRSD_UINT32 = 0,
+ _UVRSD_VFPX = 1,
+ _UVRSD_UINT64 = 3,
+ _UVRSD_FLOAT = 4,
+ _UVRSD_DOUBLE = 5
+} _Unwind_VRS_DataRepresentation;
+
+typedef enum {
+ _UVRSR_OK = 0,
+ _UVRSR_NOT_IMPLEMENTED = 1,
+ _UVRSR_FAILED = 2
+} _Unwind_VRS_Result;
+
+extern void _Unwind_Complete(_Unwind_Exception* exception_object);
+
+extern _Unwind_VRS_Result
+_Unwind_VRS_Get(_Unwind_Context *context, _Unwind_VRS_RegClass regclass,
+ uint32_t regno, _Unwind_VRS_DataRepresentation representation,
+ void *valuep);
+
+extern _Unwind_VRS_Result
+_Unwind_VRS_Set(_Unwind_Context *context, _Unwind_VRS_RegClass regclass,
+ uint32_t regno, _Unwind_VRS_DataRepresentation representation,
+ void *valuep);
+
+extern _Unwind_VRS_Result
+_Unwind_VRS_Pop(_Unwind_Context *context, _Unwind_VRS_RegClass regclass,
+ uint32_t discriminator,
+ _Unwind_VRS_DataRepresentation representation);
+
+#if defined(_LIBUNWIND_UNWIND_LEVEL1_EXTERNAL_LINKAGE)
+#define _LIBUNWIND_EXPORT_UNWIND_LEVEL1 extern
+#else
+#define _LIBUNWIND_EXPORT_UNWIND_LEVEL1 static __inline__
+#endif
+
+// These are de facto helper functions for ARM, which delegate the function
+// calls to _Unwind_VRS_Get/Set(). These are not a part of ARM EHABI
+// specification, thus these function MUST be inlined. Please don't replace
+// these with the "extern" function declaration; otherwise, the program
+// including this <unwind.h> header won't be ABI compatible and will result in
+// link error when we are linking the program with libgcc.
+
+_LIBUNWIND_EXPORT_UNWIND_LEVEL1
+uintptr_t _Unwind_GetGR(struct _Unwind_Context *context, int index) {
+ uintptr_t value = 0;
+ _Unwind_VRS_Get(context, _UVRSC_CORE, (uint32_t)index, _UVRSD_UINT32, &value);
+ return value;
+}
+
+_LIBUNWIND_EXPORT_UNWIND_LEVEL1
+void _Unwind_SetGR(struct _Unwind_Context *context, int index,
+ uintptr_t value) {
+ _Unwind_VRS_Set(context, _UVRSC_CORE, (uint32_t)index, _UVRSD_UINT32, &value);
+}
+
+_LIBUNWIND_EXPORT_UNWIND_LEVEL1
+uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) {
+ // remove the thumb-bit before returning
+ return _Unwind_GetGR(context, 15) & (~(uintptr_t)0x1);
+}
+
+_LIBUNWIND_EXPORT_UNWIND_LEVEL1
+void _Unwind_SetIP(struct _Unwind_Context *context, uintptr_t value) {
+ uintptr_t thumb_bit = _Unwind_GetGR(context, 15) & ((uintptr_t)0x1);
+ _Unwind_SetGR(context, 15, value | thumb_bit);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
#endif // __ARM_EHABI_UNWIND_H__
diff --git a/contrib/libs/libunwind/include/unwind_itanium.h b/contrib/libs/libunwind/include/unwind_itanium.h
index 9a415d243b..d94a6183be 100644
--- a/contrib/libs/libunwind/include/unwind_itanium.h
+++ b/contrib/libs/libunwind/include/unwind_itanium.h
@@ -1,76 +1,76 @@
//===----------------------------------------------------------------------===//
-//
+//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//
-// C++ ABI Level 1 ABI documented at:
+//
+//
+// C++ ABI Level 1 ABI documented at:
// https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html
-//
-//===----------------------------------------------------------------------===//
-
+//
+//===----------------------------------------------------------------------===//
+
#ifndef __ITANIUM_UNWIND_H__
#define __ITANIUM_UNWIND_H__
-
-struct _Unwind_Context; // opaque
-struct _Unwind_Exception; // forward declaration
-typedef struct _Unwind_Exception _Unwind_Exception;
+
+struct _Unwind_Context; // opaque
+struct _Unwind_Exception; // forward declaration
+typedef struct _Unwind_Exception _Unwind_Exception;
typedef uint64_t _Unwind_Exception_Class;
-
-struct _Unwind_Exception {
+
+struct _Unwind_Exception {
_Unwind_Exception_Class exception_class;
- void (*exception_cleanup)(_Unwind_Reason_Code reason,
- _Unwind_Exception *exc);
+ void (*exception_cleanup)(_Unwind_Reason_Code reason,
+ _Unwind_Exception *exc);
#if defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__)
uintptr_t private_[6];
#else
- uintptr_t private_1; // non-zero means forced unwind
- uintptr_t private_2; // holds sp that phase1 found for phase2 to use
+ uintptr_t private_1; // non-zero means forced unwind
+ uintptr_t private_2; // holds sp that phase1 found for phase2 to use
#endif
#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 (48 with SEH). To be more explicit, we add
// pad fields added for binary compatibility.
- uint32_t reserved[3];
-#endif
+ uint32_t reserved[3];
+#endif
// The Itanium ABI requires that _Unwind_Exception objects are "double-word
// aligned". GCC has interpreted this to mean "use the maximum useful
// alignment for the target"; so do we.
} __attribute__((__aligned__));
-
+
typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn)(
int version, _Unwind_Action actions, uint64_t exceptionClass,
_Unwind_Exception *exceptionObject, struct _Unwind_Context *context);
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-//
-// The following are the base functions documented by the C++ ABI
-//
-#ifdef __USING_SJLJ_EXCEPTIONS__
-extern _Unwind_Reason_Code
- _Unwind_SjLj_RaiseException(_Unwind_Exception *exception_object);
-extern void _Unwind_SjLj_Resume(_Unwind_Exception *exception_object);
-#else
-extern _Unwind_Reason_Code
- _Unwind_RaiseException(_Unwind_Exception *exception_object);
-extern void _Unwind_Resume(_Unwind_Exception *exception_object);
-#endif
-extern void _Unwind_DeleteException(_Unwind_Exception *exception_object);
-
-
-extern uintptr_t _Unwind_GetGR(struct _Unwind_Context *context, int index);
-extern void _Unwind_SetGR(struct _Unwind_Context *context, int index,
- uintptr_t new_value);
-extern uintptr_t _Unwind_GetIP(struct _Unwind_Context *context);
-extern void _Unwind_SetIP(struct _Unwind_Context *, uintptr_t new_value);
-
-#ifdef __cplusplus
-}
-#endif
-
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//
+// The following are the base functions documented by the C++ ABI
+//
+#ifdef __USING_SJLJ_EXCEPTIONS__
+extern _Unwind_Reason_Code
+ _Unwind_SjLj_RaiseException(_Unwind_Exception *exception_object);
+extern void _Unwind_SjLj_Resume(_Unwind_Exception *exception_object);
+#else
+extern _Unwind_Reason_Code
+ _Unwind_RaiseException(_Unwind_Exception *exception_object);
+extern void _Unwind_Resume(_Unwind_Exception *exception_object);
+#endif
+extern void _Unwind_DeleteException(_Unwind_Exception *exception_object);
+
+
+extern uintptr_t _Unwind_GetGR(struct _Unwind_Context *context, int index);
+extern void _Unwind_SetGR(struct _Unwind_Context *context, int index,
+ uintptr_t new_value);
+extern uintptr_t _Unwind_GetIP(struct _Unwind_Context *context);
+extern void _Unwind_SetIP(struct _Unwind_Context *, uintptr_t new_value);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif // __ITANIUM_UNWIND_H__