aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/raise-gcc.c
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2012-07-09 15:04:59 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2012-07-09 15:04:59 +0200
commita6f0cb16c658263c398773c27387adc6b10b236c (patch)
treefb77b7b5b44c1f6a19636abaad55d26ba365a9ef /gcc/ada/raise-gcc.c
parent02663f24a578d0ada1aa44220f545b4e0fe09c29 (diff)
downloadgcc-a6f0cb16c658263c398773c27387adc6b10b236c.zip
gcc-a6f0cb16c658263c398773c27387adc6b10b236c.tar.gz
gcc-a6f0cb16c658263c398773c27387adc6b10b236c.tar.bz2
[multiple changes]
2012-07-09 Tristan Gingold <gingold@adacore.com> * a-exexpr-gcc.adb (CleanupUnwind_Handler): Now imported from raise-gcc.c * raise-gcc.c (__gnat_cleanupunwind_handler): Defined. Strictly follow the ABI convention on ia64. 2012-07-09 Gary Dismukes <dismukes@adacore.com> * a-ststio.ads: Add pragma Preelaborate, per AI05-0283. * i-cstrea.ads (max_path_len): Change from variable to deferred constant to allow it to be used as a bound in string component in type System.File_IO.Temp_File_Record. * s-os_lib.ads, s-commun.ads, s-ficobl.ads, s-fileio.ads: Add pragma Preelaborate. * s-fileio.adb (Get_Case_Sensitive): Move function inside procedure Open. (File_Names_Case_Sensitive): Move variable inside procedure Open, to avoid violation of Preelaborate restriction (due to call to Get_Case_Sensitive). 2012-07-09 Ed Schonberg <schonberg@adacore.com> * layout.adb (Set_Elem_Alignment): Protect against meaningless size clause, to prevent overflow in internal computation of alignment. From-SVN: r189375
Diffstat (limited to 'gcc/ada/raise-gcc.c')
-rw-r--r--gcc/ada/raise-gcc.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/ada/raise-gcc.c b/gcc/ada/raise-gcc.c
index 0ef580b..b0f83a9 100644
--- a/gcc/ada/raise-gcc.c
+++ b/gcc/ada/raise-gcc.c
@@ -58,6 +58,7 @@ typedef char bool;
#if defined (__hpux__) && defined (USE_LIBUNWIND_EXCEPTIONS)
/* HP-UX B.11.31 ia64 libunwind doesn't have _Unwind_GetIPInfo. */
#undef HAVE_GETIPINFO
+#define _UA_END_OF_STACK 0
#endif
/* The names of a couple of "standard" routines for unwinding/propagation
@@ -77,6 +78,7 @@ _Unwind_Reason_Code
__gnat_Unwind_ForcedUnwind (_Unwind_Exception *, void *, void *);
extern void __gnat_setup_current_excep (_Unwind_Exception *);
+extern void __gnat_unhandled_except_handler (_Unwind_Exception *);
#include "dwarf2.h"
#include "unwind-dw2-fde.h"
@@ -1139,6 +1141,30 @@ PERSONALITY_FUNCTION (version_arg_t version_arg,
return _URC_INSTALL_CONTEXT;
}
+_Unwind_Reason_Code
+__gnat_cleanupunwind_handler (int version,
+ _Unwind_Action phases,
+ _Unwind_Exception_Class eclass,
+ struct _Unwind_Exception *exception,
+ struct _Unwind_Context *context,
+ void *arg)
+{
+ /* Terminate when the end of the stack is reached. */
+ if ((phases & _UA_END_OF_STACK) != 0
+#ifdef __ia64__
+ /* Strictely follow the ia64 ABI: when end of stack is reached,
+ the callback will be called with a NULL stack pointer. */
+ || _Unwind_GetREG (context, 12) == 0
+#endif
+ )
+ __gnat_unhandled_except_handler (exception);
+
+ /* We know there is at least one cleanup further up. Return so that it
+ is searched and entered, after which Unwind_Resume will be called
+ and this hook will gain control again. */
+ return _URC_NO_REASON;
+}
+
/* Define the consistently named wrappers imported by Propagate_Exception. */
#ifdef __USING_SJLJ_EXCEPTIONS__