summaryrefslogtreecommitdiff
path: root/gcc/ada/a-exexpr.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2012-07-16 12:51:41 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2012-07-16 12:51:41 +0000
commit9f6613395c8d087729fdf8cd7b9840bbc3e06591 (patch)
tree519b73a3579b0657a1ff1d6be8e64614831db7cd /gcc/ada/a-exexpr.adb
parentb62cafaaf073f368337f4c5ba3319c4e739fa1fe (diff)
downloadgcc-9f6613395c8d087729fdf8cd7b9840bbc3e06591.tar.gz
2012-07-16 Robert Dewar <dewar@adacore.com>
* freeze.adb, g-debpoo.adb, exp_ch3.adb: Minor reformatting. 2012-07-16 Thomas Quinot <quinot@adacore.com> * s-oscons-tmplt.c: Add definitions of E2BIG and EILSEQ. 2012-07-16 Tristan Gingold <gingold@adacore.com> * a-exexpr.adb (Propagate_Continue): New function replacing Raise_Current_Excep. (Allocate_Occurrence): New function. (Propagate_Exception): Add Excep parameter, remove call to Call_Chain. * a-exexpr-gcc.adb (GNAT_GCC_Exception): Occurrence component is now aliased. (To_GCC_Exception): Convert from Address. (Allocate_Occurrence): Allocate an Unwind exception occurrence. (Setup_Current_Excep): Fill the machine occurrence in case of foreign exception. (Propagate_Exception): Add Excep parameter, remove call to Call_Chain. * a-except.adb (Set_Exception_C_Msg, Set_Exception_Msg): add Excep parameter. (Raise_Exception, Raise_Exception_Always, Raise_Exception_No_Defer): Adjust calls to the above procedures. (Raise_From_Signal_Handler, Raise_With_Location_And_Msg) (Rcheck_PE_Finalize_Raised_Exception): Likewise. * a-except-2005.adb (Set_Exception_C_Msg, Set_Exception_Msg): add Excep parameter. (Propagate_Exception): Likewise. (Allocate_Occurrence): New function. (Raise_Current_Excep): Removed. (Complete_Occurrence): New function to save the call chain. (Complete_And_Propagate_Occurrence): New procedure. (Create_Occurrence_From_Signal_Handler): New function to build an occurrence without propagating it. (Create_Machine_Occurrence_From_Signal_Handler): Likewise, but return the machine occurrence. (Raise_From_Signal_Handler): Use Create_Occurrence_From_Signal_Handler. (Raise_Exception, Raise_Exception_Always, Raise_Exception_No_Defer): Adjust calls to the above procedures. Allocate the occurrence at the beginning. (Raise_With_Location_And_Msg, Raise_With_Msg) (Rcheck_PE_Finalize_Raised_Exceptionm Reraise): Likewise. (Reraise_Occurrence): Use Reraise_Occurrence_Always. (Reraise_Occurrence_Always): Use Reraise_Occurrence_No_Defer. (Reraise_Occurrence_No_Defer): Preserve machine occurrence. (Save_Occurrence): Do not save machine occurrence. * a-except-2005.ads (Exception_Occurrence): Add Machine_Occurrence component. (Null_Occurrence): Consider it. * a-exexda.adb (Set_Exception_C_Msg, Set_Exception_Msg): add Excep parameter. 2012-07-16 Tristan Gingold <gingold@adacore.com> * seh_init.c (__gnat_map_SEH): New function extracted from __gnat_SEH_error_handler. * raise-gcc.c: __gnat_personality_seh0: Directly transforms Windows system exception into GCC one when possible, in order to save stack room (particularly useful when Storage_Error will be propagated). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@189530 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-exexpr.adb')
-rw-r--r--gcc/ada/a-exexpr.adb58
1 files changed, 27 insertions, 31 deletions
diff --git a/gcc/ada/a-exexpr.adb b/gcc/ada/a-exexpr.adb
index cbe8a5c1c38..ccedcb2d1ef 100644
--- a/gcc/ada/a-exexpr.adb
+++ b/gcc/ada/a-exexpr.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -43,42 +43,29 @@ package body Exception_Propagation is
pragma No_Return (builtin_longjmp);
pragma Import (Intrinsic, builtin_longjmp, "__builtin_longjmp");
+ procedure Propagate_Continue (Excep : EOA);
+ pragma No_Return (Propagate_Continue);
+ pragma Export (C, Propagate_Continue, "__gnat_raise_nodefer_with_msg");
+ -- A call to this procedure is inserted automatically by GIGI, in order
+ -- to continue the propagation when the exception was not handled.
+ -- The linkage name is historical.
+
-------------------------
- -- Propagate_Exception --
+ -- Allocate_Occurrence --
-------------------------
- procedure Propagate_Exception
- is
- Jumpbuf_Ptr : constant Address := Get_Jmpbuf_Address.all;
- Excep : constant EOA := Get_Current_Excep.all;
+ function Allocate_Occurrence return EOA is
begin
- -- Compute the backtrace for this occurrence if corresponding binder
- -- option has been set. Call_Chain takes care of the reraise case.
-
- Call_Chain (Excep);
-
- -- Note on above call to Call_Chain:
-
- -- We used to only do this if From_Signal_Handler was not set,
- -- based on the assumption that backtracing from a signal handler
- -- would not work due to stack layout oddities. However, since
-
- -- 1. The flag is never set in tasking programs (Notify_Exception
- -- performs regular raise statements), and
-
- -- 2. No problem has shown up in tasking programs around here so
- -- far, this turned out to be too strong an assumption.
-
- -- As, in addition, the test was
-
- -- 1. preventing the production of backtraces in non-tasking
- -- programs, and
+ return Get_Current_Excep.all;
+ end Allocate_Occurrence;
- -- 2. introducing a behavior inconsistency between
- -- the tasking and non-tasking cases,
-
- -- we have simply removed it
+ -------------------------
+ -- Propagate_Exception --
+ -------------------------
+ procedure Propagate_Exception (Excep : EOA) is
+ Jumpbuf_Ptr : constant Address := Get_Jmpbuf_Address.all;
+ begin
-- If the jump buffer pointer is non-null, transfer control using
-- it. Otherwise announce an unhandled exception (note that this
-- means that we have no finalizations to do other than at the outer
@@ -98,4 +85,13 @@ package body Exception_Propagation is
end if;
end Propagate_Exception;
+ ------------------------
+ -- Propagate_Continue --
+ ------------------------
+
+ procedure Propagate_Continue (Excep : EOA) is
+ begin
+ Propagate_Exception (Excep);
+ end Propagate_Continue;
+
end Exception_Propagation;