aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/a-except.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-07-30 16:19:54 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-07-30 16:19:54 +0200
commit6b6bce610bb78e3cbe6a7d00d66270b9ba71e5a8 (patch)
tree5a27c9cce12e8e664f23c1dc8956804c65b0ee10 /gcc/ada/a-except.adb
parentfacfa16502ba988917c46d40d0b2cad07c989bc3 (diff)
downloadgcc-6b6bce610bb78e3cbe6a7d00d66270b9ba71e5a8.zip
gcc-6b6bce610bb78e3cbe6a7d00d66270b9ba71e5a8.tar.gz
gcc-6b6bce610bb78e3cbe6a7d00d66270b9ba71e5a8.tar.bz2
[multiple changes]
2014-07-30 Ed Schonberg <schonberg@adacore.com> * a-chtgop.ads, a-chtgop.adb (Delete_Node_At_Index): New subprogram, used by all versions of hashed sets, to delete a node whose element has been improperly updated through a Reference_ Preserving key. * a-cohase.adb: Remove Delete_Node, use new common procedure Delete_Node_At_Index. * a-cihase.ads: Add Reference_Control_Type to package Generic_Keys. * a-cihase.adb: Add Adjust and Finalize routines for Reference_Control_Type. (Reference_Preserving_Key): Build aggregate for Reference_Control_Type 2014-07-30 Yannick Moy <moy@adacore.com> * checks.adb, checks.ads (Determine_Range_R): New procedure to determine the possible range of a floating-point expression. 2014-07-30 Ed Schonberg <schonberg@adacore.com> * a-cborse.ads: Add Reference_Control_Type to package Generic_Keys. * a-cborse.adb: Add Adjust and Finalize routines for Reference_Control_Type. (Reference_Preserving_Key): Build aggregate for Reference_Control_Type. (Delete): Check for tampering, and raise Program_Error (not Constraint_Error) when attempting to delete an element not in the set. (Insert): Ditto. 2014-07-30 Bob Duff <duff@adacore.com> * a-elchha.adb, a-except-2005.adb, a-except.adb, a-exexda.adb, * a-exextr.adb, a-exstat.adb, exp_intr.ads, s-tassta.adb: Exception_Information is used to produce useful debugging information for the programmer. However, it was also used to implement the stream attributes for type Exception_Occurrence. The latter requires a stable and portable interface, which meant that we couldn't include a symbolic traceback. A separate set of routines was used to provide symbolic tracebacks under program control (i.e. not automatically). The goal of this ticket is to provide such automatic tracebacks, so the change here is to split the two functionalities: Exception_Information gives the maximally useful information for debugging (i.e. it now includes a symbolic traceback when a decorator is set, and it can be improved freely in the future without disturbing streaming). Untailored_Exception_Information always uses hexadecimal addresses in the traceback, has a stable and portable output, and is now used for streaming. 2014-07-30 Eric Botcazou <ebotcazou@adacore.com> * exp_aggr.adb (Expand_Array_Aggregate): Add missing test on the target of the assignment to find out whether it can be directly done by the back-end. * exp_util.adb (Is_Possibly_Unaligned_Slice): Remove obscure test. From-SVN: r213279
Diffstat (limited to 'gcc/ada/a-except.adb')
-rw-r--r--gcc/ada/a-except.adb62
1 files changed, 28 insertions, 34 deletions
diff --git a/gcc/ada/a-except.adb b/gcc/ada/a-except.adb
index 2d496fb..f90858e 100644
--- a/gcc/ada/a-except.adb
+++ b/gcc/ada/a-except.adb
@@ -116,12 +116,17 @@ package body Ada.Exceptions is
-- message. Message is a string which is generated as the exception
-- message.
- --------------------------------------
- -- Exception information subprogram --
- --------------------------------------
+ ---------------------------------------
+ -- Exception information subprograms --
+ ---------------------------------------
- function Exception_Information (X : Exception_Occurrence) return String;
- -- The format of the exception information is as follows:
+ function Untailored_Exception_Information
+ (X : Exception_Occurrence) return String;
+ -- This is used by Stream_Attributes.EO_To_String to convert an
+ -- Exception_Occurrence to a String for the stream attributes.
+ -- String_To_EO understands the format, as documented here.
+ --
+ -- The format of the string is as follows:
--
-- Exception_Name: <exception name> (as in Exception_Name)
-- Message: <message> (only if Exception_Message is empty)
@@ -129,25 +134,19 @@ package body Ada.Exceptions is
-- Call stack traceback locations: (only if at least one location)
-- <0xyyyyyyyy 0xyyyyyyyy ...> (is recorded)
--
- -- The lines are separated by a ASCII.LF character
- --
- -- The nnnn is the partition Id given as decimal digits
- --
+ -- The lines are separated by a ASCII.LF character.
+ -- The nnnn is the partition Id given as decimal digits.
-- The 0x... line represents traceback program counter locations, in
-- execution order with the first one being the exception location. It
-- is present only
--
- -- The Exception_Name and Message lines are omitted in the abort signal
- -- case, since this is not really an exception.
+ -- The Exception_Name and Message lines are omitted in the abort
+ -- signal case, since this is not really an exception.
-- Note: If the format of the generated string is changed, please note
-- that an equivalent modification to the routine String_To_EO must be
-- made to preserve proper functioning of the stream attributes.
- ---------------------------------------
- -- Exception backtracing subprograms --
- ---------------------------------------
-
-- What is automatically output when exception tracing is on is the
-- usual exception information with the call chain backtrace possibly
-- tailored by a backtrace decorator. Modifying Exception_Information
@@ -157,28 +156,23 @@ package body Ada.Exceptions is
-- the possibly tailored output, which is equivalent if no decorator is
-- currently set:
- function Tailored_Exception_Information
- (X : Exception_Occurrence) return String;
- -- Exception information to be output in the case of automatic tracing
- -- requested through GNAT.Exception_Traces.
+ function Exception_Information (X : Exception_Occurrence) return String;
+ -- This is the implementation of Ada.Exceptions.Exception_Information,
+ -- as defined in the Ada RM.
--
- -- This is the same as Exception_Information if no backtrace decorator
- -- is currently in place. Otherwise, this is Exception_Information with
- -- the call chain raw addresses replaced by the result of a call to the
- -- current decorator provided with the call chain addresses.
-
- pragma Export
- (Ada, Tailored_Exception_Information,
- "__gnat_tailored_exception_information");
- -- This is currently used by System.Tasking.Stages
+ -- If no traceback decorator (see GNAT.Exception_Traces) is currently
+ -- in place, this is the same as Untailored_Exception_Information.
+ -- Otherwise, the decorator is used to produce a symbolic traceback
+ -- instead of hexadecimal addresses.
+ --
+ -- Note that unlike Untailored_Exception_Information, there is no need
+ -- to keep the output of Exception_Information stable for streaming
+ -- purposes, and in fact the output differs across platforms.
end Exception_Data;
package Exception_Traces is
- use Exception_Data;
- -- Imports Tailored_Exception_Information
-
----------------------------------------------
-- Run-Time Exception Notification Routines --
----------------------------------------------
@@ -774,7 +768,7 @@ package body Ada.Exceptions is
------------------
-- We use the null string to represent the null occurrence, otherwise we
- -- output the Exception_Information string for the occurrence.
+ -- output the Untailored_Exception_Information string for the occurrence.
function EO_To_String (X : Exception_Occurrence) return String
renames Stream_Attributes.EO_To_String;
@@ -806,9 +800,9 @@ package body Ada.Exceptions is
begin
if X.Id = Null_Id then
raise Constraint_Error;
+ else
+ return Exception_Data.Exception_Information (X);
end if;
-
- return Exception_Data.Exception_Information (X);
end Exception_Information;
-----------------------