Commit bf8f12c2 by Arnaud Charlet

[multiple changes]

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.

From-SVN: r229246
parent af29617a
2015-10-23 Hristian Kirtchev <kirtchev@adacore.com> 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, * exp_attr.adb, freeze.adb, sem_attr.adb, exp_aggr.adb,
gnatname.adb: Minor reformatting. gnatname.adb: Minor reformatting.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- 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 -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -85,7 +85,9 @@ package body Exception_Traces is ...@@ -85,7 +85,9 @@ package body Exception_Traces is
if not Excep.Id.Not_Handled_By_Others if not Excep.Id.Not_Handled_By_Others
and then and then
(Exception_Trace = Every_Raise (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 then
-- Exception trace messages need to be protected when several tasks -- Exception trace messages need to be protected when several tasks
-- can issue them at the same time. -- can issue them at the same time.
...@@ -93,12 +95,15 @@ package body Exception_Traces is ...@@ -93,12 +95,15 @@ package body Exception_Traces is
Lock_Task.all; Lock_Task.all;
To_Stderr (Nline); To_Stderr (Nline);
if Is_Unhandled then if Exception_Trace /= Unhandled_Raise_In_Main then
To_Stderr ("Unhandled "); if Is_Unhandled then
To_Stderr ("Unhandled ");
end if;
To_Stderr ("Exception raised");
To_Stderr (Nline);
end if; end if;
To_Stderr ("Exception raised");
To_Stderr (Nline);
To_Stderr (Exception_Information (Excep.all)); To_Stderr (Exception_Information (Excep.all));
Unlock_Task.all; Unlock_Task.all;
end if; end if;
...@@ -170,8 +175,8 @@ package body Exception_Traces is ...@@ -170,8 +175,8 @@ package body Exception_Traces is
-- The bulk of exception traces output is centralized in Notify_Exception, -- The bulk of exception traces output is centralized in Notify_Exception,
-- for both the Handled and Unhandled cases. Extra task specific output is -- for both the Handled and Unhandled cases. Extra task specific output is
-- triggered in the task wrapper for unhandled occurrences in tasks. It is -- triggered in the task wrapper for unhandled occurrences in tasks. It is
-- not performed in this unit to avoid dragging dependencies against the -- not performed in this unit to avoid dependencies on the tasking units
-- tasking units here. -- here.
-- We used to rely on the output performed by Unhanded_Exception_Terminate -- We used to rely on the output performed by Unhanded_Exception_Terminate
-- for the case of an unhandled occurrence in the environment thread, and -- for the case of an unhandled occurrence in the environment thread, and
...@@ -191,12 +196,4 @@ package body Exception_Traces is ...@@ -191,12 +196,4 @@ package body Exception_Traces is
-- Today's solution has the advantage of simplicity and better isolates -- Today's solution has the advantage of simplicity and better isolates
-- the Exception_Traces machinery. -- 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; end Exception_Traces;
...@@ -159,7 +159,7 @@ package body Debug is ...@@ -159,7 +159,7 @@ package body Debug is
-- d.2 Allow statements in declarative part -- d.2 Allow statements in declarative part
-- d.3 Output debugging information from Exp_Unst -- d.3 Output debugging information from Exp_Unst
-- d.4 -- d.4
-- d.5 Generate Ghost external sumbols regardless of Ghost policy -- d.5
-- d.6 -- d.6
-- d.7 -- d.7
-- d.8 -- d.8
...@@ -762,12 +762,6 @@ package body Debug is ...@@ -762,12 +762,6 @@ package body Debug is
-- d.3 Output debugging information from Exp_Unst, including the name of -- d.3 Output debugging information from Exp_Unst, including the name of
-- any unreachable subprograms that get deleted. -- 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 -- -- Documentation for Binder Debug Flags --
------------------------------------------ ------------------------------------------
......
...@@ -776,18 +776,6 @@ package body Exp_Dbug is ...@@ -776,18 +776,6 @@ package body Exp_Dbug is
E := Defining_Identifier (Entity); E := Defining_Identifier (Entity);
end if; 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 -- Case of interface name being used
if Ekind_In (E, E_Constant, if Ekind_In (E, E_Constant,
......
...@@ -76,12 +76,6 @@ package Exp_Dbug is ...@@ -76,12 +76,6 @@ package Exp_Dbug is
-- qualification for such entities. In particular this means that direct -- qualification for such entities. In particular this means that direct
-- local variables of a procedure are not qualified. -- 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 -- 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. -- 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: -- The fully qualified names of the entities X and Z are:
......
...@@ -114,6 +114,8 @@ package body System.Exception_Traces is ...@@ -114,6 +114,8 @@ package body System.Exception_Traces is
Exception_Trace := Every_Raise; Exception_Trace := Every_Raise;
when Unhandled_Raise => when Unhandled_Raise =>
Exception_Trace := Unhandled_Raise; Exception_Trace := Unhandled_Raise;
when Unhandled_Raise_In_Main =>
Exception_Trace := Unhandled_Raise_In_Main;
end case; end case;
end Trace_On; end Trace_On;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- 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 -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -61,10 +61,14 @@ package System.Exception_Traces is ...@@ -61,10 +61,14 @@ package System.Exception_Traces is
-- explicit or due to a specific language rule, within the context of a -- explicit or due to a specific language rule, within the context of a
-- task or not. -- task or not.
Unhandled_Raise Unhandled_Raise,
-- Denotes the raise events corresponding to exceptions for which there -- Denotes the raise events corresponding to exceptions for which there
-- is no user defined handler, in particular, when a task dies due to an -- is no user defined handler. This includes unhandled exceptions in
-- unhandled exception. -- 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 -- The following procedures can be used to activate and deactivate
......
...@@ -220,12 +220,23 @@ package System.Standard_Library is ...@@ -220,12 +220,23 @@ package System.Standard_Library is
-- This is the default behavior. -- This is the default behavior.
Every_Raise, Every_Raise,
-- Denotes every possible raise event, either explicit or due to -- Denotes the initial raise event for any exception occurrence, either
-- a specific language rule, within the context of a task or not. -- 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 Unhandled_Raise,
-- there is no user defined handler. -- 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 -- Provide a way to denote different kinds of automatic traces related
-- to exceptions that can be requested. -- to exceptions that can be requested.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment