summaryrefslogtreecommitdiff
path: root/gcc/ada/a-except.ads
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/a-except.ads')
-rw-r--r--gcc/ada/a-except.ads77
1 files changed, 31 insertions, 46 deletions
diff --git a/gcc/ada/a-except.ads b/gcc/ada/a-except.ads
index 73a6a29ee26..a93f056544e 100644
--- a/gcc/ada/a-except.ads
+++ b/gcc/ada/a-except.ads
@@ -39,24 +39,18 @@ pragma Polling (Off);
-- We must turn polling off for this unit, because otherwise we get
-- elaboration circularities with ourself.
-pragma Warnings (Off);
--- Allow withing of non-Preelaborated units in Ada 2005 mode where this
--- package will be categorized as Preelaborate. See AI-362 for details.
--- It is safe in the context of the run-time to violate the rules!
-
with System;
with System.Parameters;
with System.Standard_Library;
with System.Traceback_Entries;
-pragma Warnings (On);
package Ada.Exceptions is
-pragma Warnings (Off);
-pragma Preelaborate_05 (Exceptions);
-pragma Warnings (On);
--- In accordance with Ada 2005 AI-362. The warnings pragmas are so that we can
--- compile this using older compiler versions, which will ignore the pragma,
--- which is fine for the bootstrap.
+ pragma Warnings (Off);
+ pragma Preelaborate_05;
+ pragma Warnings (On);
+ -- In accordance with Ada 2005 AI-362. The warnings pragmas are so that we
+ -- can compile this using older compiler versions, which will ignore the
+ -- pragma, which is fine for the bootstrap.
type Exception_Id is private;
Null_Id : constant Exception_Id;
@@ -127,10 +121,9 @@ private
------------------
subtype Code_Loc is System.Address;
- -- Code location used in building exception tables and for call
- -- addresses when propagating an exception.
- -- Values of this type are created by using Label'Address or
- -- extracted from machine states using Get_Code_Loc.
+ -- Code location used in building exception tables and for call addresses
+ -- when propagating an exception. Values of this type are created by using
+ -- Label'Address or extracted from machine states using Get_Code_Loc.
Null_Loc : constant Code_Loc := System.Null_Address;
-- Null code location, used to flag outer level frame
@@ -161,12 +154,12 @@ private
-- to be in the visible part, since this is set by the reference manual).
function Exception_Name_Simple (X : Exception_Occurrence) return String;
- -- Like Exception_Name, but returns the simple non-qualified name of
- -- the exception. This is used to implement the Exception_Name function
- -- in Current_Exceptions (the DEC compatible unit). It is called from
- -- the compiler generated code (using Rtsfind, which does not respect
- -- the private barrier, so we can place this function in the private
- -- part where the compiler can find it, but the spec is unchanged.)
+ -- Like Exception_Name, but returns the simple non-qualified name of the
+ -- exception. This is used to implement the Exception_Name function in
+ -- Current_Exceptions (the DEC compatible unit). It is called from the
+ -- compiler generated code (using Rtsfind, which does not respect the
+ -- private barrier, so we can place this function in the private part
+ -- where the compiler can find it, but the spec is unchanged.)
procedure Raise_Exception_Always (E : Exception_Id; Message : String := "");
pragma No_Return (Raise_Exception_Always);
@@ -179,22 +172,21 @@ private
procedure Raise_From_Signal_Handler
(E : Exception_Id;
- M : SSL.Big_String_Ptr);
+ M : System.Address);
pragma Export
(Ada, Raise_From_Signal_Handler,
"ada__exceptions__raise_from_signal_handler");
pragma No_Return (Raise_From_Signal_Handler);
- -- This routine is used to raise an exception from a signal handler.
- -- The signal handler has already stored the machine state (i.e. the
- -- state that corresponds to the location at which the signal was
- -- raised). E is the Exception_Id specifying what exception is being
- -- raised, and M is a pointer to a null-terminated string which is the
- -- message to be raised. Note that this routine never returns, so it is
- -- permissible to simply jump to this routine, rather than call it. This
- -- may be appropriate for systems where the right way to get out of a
- -- signal handler is to alter the PC value in the machine state or in
- -- some other way ask the operating system to return here rather than
- -- to the original location.
+ -- This routine is used to raise an exception from a signal handler. The
+ -- signal handler has already stored the machine state (i.e. the state that
+ -- corresponds to the location at which the signal was raised). E is the
+ -- Exception_Id specifying what exception is being raised, and M is a
+ -- pointer to a null-terminated string which is the message to be raised.
+ -- Note that this routine never returns, so it is permissible to simply
+ -- jump to this routine, rather than call it. This may be appropriate for
+ -- systems where the right way to get out of signal handler is to alter the
+ -- PC value in the machine state or in some other way ask the operating
+ -- system to return here rather than to the original location.
procedure Reraise_Occurrence_Always (X : Exception_Occurrence);
pragma No_Return (Reraise_Occurrence_Always);
@@ -207,8 +199,8 @@ private
pragma No_Return (Reraise_Occurrence_No_Defer);
-- Exactly like Reraise_Occurrence, except that abort is not deferred
-- before the call and the parameter X is known not to be the null
- -- occurrence. This is used in generated code when it is known
- -- that abort is already deferred.
+ -- occurrence. This is used in generated code when it is known that
+ -- abort is already deferred.
-----------------------
-- Polling Interface --
@@ -260,7 +252,7 @@ private
Msg : String (1 .. Exception_Msg_Max_Length);
-- Characters of message
- Cleanup_Flag : Boolean;
+ Cleanup_Flag : Boolean := False;
-- The cleanup flag is normally False, it is set True for an exception
-- occurrence passed to a cleanup routine, and will still be set True
-- when the cleanup routine does a Reraise_Occurrence call using this
@@ -276,7 +268,7 @@ private
-- it is dealing with the reraise case (which is useful to distinguish
-- for exception tracing purposes).
- Pid : Natural;
+ Pid : Natural := 0;
-- Partition_Id for partition raising exception
Num_Tracebacks : Natural range 0 .. Max_Tracebacks := 0;
@@ -302,13 +294,8 @@ private
pragma Stream_Convert (Exception_Occurrence, String_To_EO, EO_To_String);
-- Functions for implementing Exception_Occurrence stream attributes
- pragma Warnings (Off);
- -- Allow non-static constants in Ada 2005 mode where this package will be
- -- implicitly categorized as Preelaborate. See AI-362 for details. It is
- -- safe in the context of the run-time to violate the rules!
-
Null_Occurrence : constant Exception_Occurrence := (
- Id => Null_Id,
+ Id => null,
Msg_Length => 0,
Msg => (others => ' '),
Cleanup_Flag => False,
@@ -318,6 +305,4 @@ private
Tracebacks => (others => TBE.Null_TB_Entry),
Private_Data => System.Null_Address);
- pragma Warnings (On);
-
end Ada.Exceptions;