+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,
-- --
-- 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- --
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.
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;
-- 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
-- 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;
-- 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
-- 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 --
------------------------------------------
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,
-- 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:
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;
-- --
-- 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- --
-- 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
-- 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.