2015-10-23 Hristian Kirtchev <kirtchev@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 23 Oct 2015 12:40:50 +0000 (12:40 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 23 Oct 2015 12:40:50 +0000 (12:40 +0000)
* 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  <duff@adacore.com>

* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229246 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/a-exextr.adb
gcc/ada/debug.adb
gcc/ada/exp_dbug.adb
gcc/ada/exp_dbug.ads
gcc/ada/s-exctra.adb
gcc/ada/s-exctra.ads
gcc/ada/s-stalib.ads

index a4dbbe5..bf8ad25 100644 (file)
@@ -1,5 +1,22 @@
 2015-10-23  Hristian Kirtchev  <kirtchev@adacore.com>
 
+       * 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  <duff@adacore.com>
+
+       * 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  <kirtchev@adacore.com>
+
        * exp_attr.adb, freeze.adb, sem_attr.adb, exp_aggr.adb,
        gnatname.adb: Minor reformatting.
 
index 94ec483..1284efa 100644 (file)
@@ -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;
index 68cca0c..29872b6 100644 (file)
@@ -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 --
    ------------------------------------------
index 37f3920..2c1d518 100644 (file)
@@ -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,
index f8df41c..827f149 100644 (file)
@@ -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:
index c19807a..1d6cabf 100644 (file)
@@ -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;
 
index 956f531..25c2f72 100644 (file)
@@ -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
index 447662b..5cfd6b3 100644 (file)
@@ -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.