diff options
Diffstat (limited to 'gcc/ada/init.c')
-rw-r--r-- | gcc/ada/init.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/ada/init.c b/gcc/ada/init.c index 4db5789526c..8a27a601617 100644 --- a/gcc/ada/init.c +++ b/gcc/ada/init.c @@ -304,6 +304,27 @@ __gnat_install_handler (void) #include <signal.h> #include <sys/ucontext.h> +#if defined (IN_RTS) && defined (__ia64__) + +#include <sys/uc_access.h> + +#define HAVE_GNAT_ADJUST_CONTEXT_FOR_RAISE + +void +__gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED, void *ucontext) +{ + ucontext_t *uc = (ucontext_t *) ucontext; + uint64_t ip; + + /* Adjust on itanium, as GetIPInfo is not supported. */ + __uc_get_ip (uc, &ip); + __uc_set_ip (uc, ip + 1); +} +#endif /* IN_RTS && __ia64__ */ + +/* Tasking and Non-tasking signal handler. Map SIGnal to Ada exception + propagation after the required low level adjustments. */ + static void __gnat_error_handler (int sig, siginfo_t *si ATTRIBUTE_UNUSED, @@ -312,6 +333,8 @@ __gnat_error_handler (int sig, struct Exception_Data *exception; const char *msg; + __gnat_adjust_context_for_raise (sig, ucontext); + switch (sig) { case SIGSEGV: |