diff options
Diffstat (limited to 'gcc/ada/init.c')
-rw-r--r-- | gcc/ada/init.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/gcc/ada/init.c b/gcc/ada/init.c index 8d2f4e1..b6d6e6a 100644 --- a/gcc/ada/init.c +++ b/gcc/ada/init.c @@ -2282,11 +2282,12 @@ __gnat_is_stack_guard (mach_vm_address_t addr) return 0; } -static void -__gnat_error_handler (int sig, siginfo_t *si, void *ucontext ATTRIBUTE_UNUSED) +#define HAVE_GNAT_ADJUST_CONTEXT_FOR_RAISE + +void +__gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED, + void *ucontext ATTRIBUTE_UNUSED) { - struct Exception_Data *exception; - const char *msg; #if defined (__x86_64__) /* Work around radar #10302855/pr50678, where the unwinders (libunwind or libgcc_s depending on the system revision) and the DWARF unwind data for @@ -2294,9 +2295,19 @@ __gnat_error_handler (int sig, siginfo_t *si, void *ucontext ATTRIBUTE_UNUSED) and rdx to be transposed).. */ ucontext_t *uc = (ucontext_t *)ucontext ; unsigned long t = uc->uc_mcontext->__ss.__rbx; + uc->uc_mcontext->__ss.__rbx = uc->uc_mcontext->__ss.__rdx; uc->uc_mcontext->__ss.__rdx = t; #endif +} + +static void +__gnat_error_handler (int sig, siginfo_t *si, void *ucontext) +{ + struct Exception_Data *exception; + const char *msg; + + __gnat_adjust_context_for_raise (sig, ucontext); switch (sig) { |