From bf8f12c2a6b7c557031b431909fc831a6f6d7763 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Fri, 23 Oct 2015 14:40:50 +0200 Subject: [PATCH] [multiple changes] 2015-10-23 Hristian Kirtchev * debug.adb: Switch -gnatd.5 is no longer in use, remove the associated documentation. * exp_dbug.adb (Get_External_Name): Do not add a special prefix for ignored Ghost entities or when switch -gnatd.5 is enabled. * exp_dbug.ads Remove the documentation concerning the encoding of ignored Ghost entities. 2015-10-23 Bob Duff * a-exextr.adb (Notify_Exception): For Unhandled_Raise_In_Main, mimic the output from Ada.Exceptions.Last_Chance_Handler; don't print "Exception raised". * s-stalib.ads, s-exctra.ads, s-exctra.adb: Add Unhandled_Raise_In_Main to types Exception_Trace_Kind/Trace_Kind. From-SVN: r229246 --- gcc/ada/ChangeLog | 17 +++++++++++++++++ gcc/ada/a-exextr.adb | 29 +++++++++++++---------------- gcc/ada/debug.adb | 8 +------- gcc/ada/exp_dbug.adb | 12 ------------ gcc/ada/exp_dbug.ads | 6 ------ gcc/ada/s-exctra.adb | 2 ++ gcc/ada/s-exctra.ads | 12 ++++++++---- gcc/ada/s-stalib.ads | 23 +++++++++++++++++------ 8 files changed, 58 insertions(+), 51 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index a4dbbe5f72e..bf8ad25c85b 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,20 @@ +2015-10-23 Hristian Kirtchev + + * debug.adb: Switch -gnatd.5 is no longer in use, remove the + associated documentation. + * exp_dbug.adb (Get_External_Name): Do not add a special prefix + for ignored Ghost entities or when switch -gnatd.5 is enabled. + * exp_dbug.ads Remove the documentation concerning the encoding + of ignored Ghost entities. + +2015-10-23 Bob Duff + + * a-exextr.adb (Notify_Exception): For Unhandled_Raise_In_Main, + mimic the output from Ada.Exceptions.Last_Chance_Handler; don't + print "Exception raised". + * s-stalib.ads, s-exctra.ads, s-exctra.adb: Add + Unhandled_Raise_In_Main to types Exception_Trace_Kind/Trace_Kind. + 2015-10-23 Hristian Kirtchev * exp_attr.adb, freeze.adb, sem_attr.adb, exp_aggr.adb, diff --git a/gcc/ada/a-exextr.adb b/gcc/ada/a-exextr.adb index 94ec48338f9..1284efa6908 100644 --- a/gcc/ada/a-exextr.adb +++ b/gcc/ada/a-exextr.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2014, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2015, 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- -- @@ -85,7 +85,9 @@ package body Exception_Traces is if not Excep.Id.Not_Handled_By_Others and then (Exception_Trace = Every_Raise - or else (Exception_Trace = Unhandled_Raise and then Is_Unhandled)) + or else (Is_Unhandled + and then (Exception_Trace = Unhandled_Raise + or else Exception_Trace = Unhandled_Raise_In_Main))) then -- Exception trace messages need to be protected when several tasks -- can issue them at the same time. @@ -93,12 +95,15 @@ package body Exception_Traces is Lock_Task.all; To_Stderr (Nline); - if Is_Unhandled then - To_Stderr ("Unhandled "); + if Exception_Trace /= Unhandled_Raise_In_Main then + if Is_Unhandled then + To_Stderr ("Unhandled "); + end if; + + To_Stderr ("Exception raised"); + To_Stderr (Nline); end if; - To_Stderr ("Exception raised"); - To_Stderr (Nline); To_Stderr (Exception_Information (Excep.all)); Unlock_Task.all; end if; @@ -170,8 +175,8 @@ package body Exception_Traces is -- The bulk of exception traces output is centralized in Notify_Exception, -- for both the Handled and Unhandled cases. Extra task specific output is -- triggered in the task wrapper for unhandled occurrences in tasks. It is - -- not performed in this unit to avoid dragging dependencies against the - -- tasking units here. + -- not performed in this unit to avoid dependencies on the tasking units + -- here. -- We used to rely on the output performed by Unhanded_Exception_Terminate -- for the case of an unhandled occurrence in the environment thread, and @@ -191,12 +196,4 @@ package body Exception_Traces is -- Today's solution has the advantage of simplicity and better isolates -- the Exception_Traces machinery. - -- It currently outputs the information about unhandled exceptions twice - -- in the environment thread, once in the notification routine and once in - -- the termination routine. Avoiding the second output is possible but so - -- far has been considered undesirable. It would mean changing the order - -- of outputs between the two runs with or without exception traces, while - -- it seems preferable to only have additional outputs in the former - -- case. - end Exception_Traces; diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb index 68cca0c43c1..29872b630a0 100644 --- a/gcc/ada/debug.adb +++ b/gcc/ada/debug.adb @@ -159,7 +159,7 @@ package body Debug is -- d.2 Allow statements in declarative part -- d.3 Output debugging information from Exp_Unst -- d.4 - -- d.5 Generate Ghost external sumbols regardless of Ghost policy + -- d.5 -- d.6 -- d.7 -- d.8 @@ -762,12 +762,6 @@ package body Debug is -- d.3 Output debugging information from Exp_Unst, including the name of -- any unreachable subprograms that get deleted. - -- d.5 Generate specialized external symbols for Ghost entities where the - -- name of the entity is prefixed by "_ghost_" regardless of whether - -- the Ghost policy is Check or Ignore. WARNING: This switch may cause - -- linking issues related to Ghost entities declared with Ghost policy - -- Check. - ------------------------------------------ -- Documentation for Binder Debug Flags -- ------------------------------------------ diff --git a/gcc/ada/exp_dbug.adb b/gcc/ada/exp_dbug.adb index 37f3920370d..2c1d5180faa 100644 --- a/gcc/ada/exp_dbug.adb +++ b/gcc/ada/exp_dbug.adb @@ -776,18 +776,6 @@ package body Exp_Dbug is E := Defining_Identifier (Entity); end if; - -- Add a special prefix to distinguish ignored Ghost entities. These - -- entities should not leak in the "living" space and they should be - -- removed by the compiler in a post-processing pass. The prefix is - -- also added to any kind of Ghost entity when switch -gnatd.5 is - -- enabled. - - if Is_Ignored_Ghost_Entity (E) - or else (Debug_Flag_Dot_5 and Is_Ghost_Entity (E)) - then - Add_Str_To_Name_Buffer ("___ghost_"); - end if; - -- Case of interface name being used if Ekind_In (E, E_Constant, diff --git a/gcc/ada/exp_dbug.ads b/gcc/ada/exp_dbug.ads index f8df41cb794..827f149f705 100644 --- a/gcc/ada/exp_dbug.ads +++ b/gcc/ada/exp_dbug.ads @@ -76,12 +76,6 @@ package Exp_Dbug is -- qualification for such entities. In particular this means that direct -- local variables of a procedure are not qualified. - -- For ignored Ghost entities, the encoding adds a prefix "___ghost_" to - -- aid the detection of leaks in the "living" space. Ignored Ghost entities - -- and any code associated with them should be removed by the compiler in a - -- post-processing pass. As a result, object files should not contain any - -- occurrences of this prefix. - -- As an example of the local name convention, consider a procedure V.W -- with a local variable X, and a nested block Y containing an entity Z. -- The fully qualified names of the entities X and Z are: diff --git a/gcc/ada/s-exctra.adb b/gcc/ada/s-exctra.adb index c19807a4bf4..1d6cabfcc82 100644 --- a/gcc/ada/s-exctra.adb +++ b/gcc/ada/s-exctra.adb @@ -114,6 +114,8 @@ package body System.Exception_Traces is Exception_Trace := Every_Raise; when Unhandled_Raise => Exception_Trace := Unhandled_Raise; + when Unhandled_Raise_In_Main => + Exception_Trace := Unhandled_Raise_In_Main; end case; end Trace_On; diff --git a/gcc/ada/s-exctra.ads b/gcc/ada/s-exctra.ads index 956f531284c..25c2f729dbc 100644 --- a/gcc/ada/s-exctra.ads +++ b/gcc/ada/s-exctra.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2000-2014, AdaCore -- +-- Copyright (C) 2000-2015, AdaCore -- -- -- -- 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- -- @@ -61,10 +61,14 @@ package System.Exception_Traces is -- explicit or due to a specific language rule, within the context of a -- task or not. - Unhandled_Raise + Unhandled_Raise, -- Denotes the raise events corresponding to exceptions for which there - -- is no user defined handler, in particular, when a task dies due to an - -- unhandled exception. + -- is no user defined handler. This includes unhandled exceptions in + -- task bodies. + + Unhandled_Raise_In_Main + -- Same as Unhandled_Raise, except exceptions in task bodies are not + -- included. ); -- The following procedures can be used to activate and deactivate diff --git a/gcc/ada/s-stalib.ads b/gcc/ada/s-stalib.ads index 447662b5e91..5cfd6b37e03 100644 --- a/gcc/ada/s-stalib.ads +++ b/gcc/ada/s-stalib.ads @@ -220,12 +220,23 @@ package System.Standard_Library is -- This is the default behavior. Every_Raise, - -- Denotes every possible raise event, either explicit or due to - -- a specific language rule, within the context of a task or not. - - Unhandled_Raise - -- Denotes the raise events corresponding to exceptions for which - -- there is no user defined handler. + -- Denotes the initial raise event for any exception occurrence, either + -- explicit or due to a specific language rule, within the context of a + -- task or not. + + Unhandled_Raise, + -- Denotes the raise events corresponding to exceptions for which there + -- is no user defined handler. This includes unhandled exceptions in + -- task bodies. + + Unhandled_Raise_In_Main + -- Same as Unhandled_Raise, except exceptions in task bodies are not + -- included. Same as RM_Convention, except (1) the message is printed as + -- soon as the environment task completes due to an unhandled exception + -- (before awaiting the termination of dependent tasks, and before + -- library-level finalization), and (2) a symbolic traceback is given + -- if possible. This is the default behavior if the binder switch -E is + -- used. ); -- Provide a way to denote different kinds of automatic traces related -- to exceptions that can be requested. -- 2.30.2