diff options
Diffstat (limited to 'gcc/ada/a-exexpr-gcc.adb')
-rw-r--r-- | gcc/ada/a-exexpr-gcc.adb | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/gcc/ada/a-exexpr-gcc.adb b/gcc/ada/a-exexpr-gcc.adb index 2f2e7a7..014b48f 100644 --- a/gcc/ada/a-exexpr-gcc.adb +++ b/gcc/ada/a-exexpr-gcc.adb @@ -205,6 +205,15 @@ package body Exception_Propagation is pragma Export (C, Setup_Current_Excep, "__gnat_setup_current_excep"); -- Write Get_Current_Excep.all from GCC_Exception + procedure Unhandled_Except_Handler + (GCC_Exception : not null GCC_Exception_Access); + pragma No_Return (Unhandled_Except_Handler); + pragma Export (C, Unhandled_Except_Handler, + "__gnat_unhandled_except_handler"); + -- Called for handle unhandled exceptions, ie the last chance handler + -- on platforms (such as SEH) that never returns after throwing an + -- exception. Called directly by gigi. + function CleanupUnwind_Handler (UW_Version : Integer; UW_Phases : Unwind_Action; @@ -280,6 +289,12 @@ package body Exception_Propagation is All_Others_Value : constant Integer := 16#7FFF#; pragma Export (C, All_Others_Value, "__gnat_all_others_value"); + Unhandled_Others_Value : constant Integer := 16#7FFF#; + pragma Export (C, Unhandled_Others_Value, "__gnat_unhandled_others_value"); + -- Special choice (emitted by gigi) to catch and notify unhandled + -- exceptions on targets which always handle exceptions (such as SEH). + -- The handler will simply call Unhandled_Except_Handler. + -------------------------------- -- GNAT_GCC_Exception_Cleanup -- -------------------------------- @@ -319,8 +334,7 @@ package body Exception_Propagation is -- Terminate when the end of the stack is reached if UW_Phases >= UA_END_OF_STACK then - Setup_Current_Excep (UW_Exception); - Unhandled_Exception_Terminate; + Unhandled_Except_Handler (UW_Exception); end if; -- We know there is at least one cleanup further up. Return so that it @@ -438,9 +452,20 @@ package body Exception_Propagation is -- We get here in case of error. The debugger has been notified before -- the second step above. + Unhandled_Except_Handler (GCC_Exception); + end Propagate_GCC_Exception; + + ------------------------------ + -- Unhandled_Except_Handler -- + ------------------------------ + + procedure Unhandled_Except_Handler + (GCC_Exception : not null GCC_Exception_Access) + is + begin Setup_Current_Excep (GCC_Exception); Unhandled_Exception_Terminate; - end Propagate_GCC_Exception; + end Unhandled_Except_Handler; ------------------------- -- Propagate_Exception -- |