Commit 6f301919 by Arnaud Charlet

2006-02-13 Arnaud Charlet <charlet@adacore.com>

	    Robert Dewar  <dewar@adacore.com>

	* a-exexpr.adb, a-exexpr-gcc.adb
	(Process_Raise_Exception): Removed, merged with Propagate_Exception.
	(Propagate_Exception): Now take extra From_Signal_Handler parameter.
	Remove code unused for exception propagation for the compiler itself
 	from a-except.adb and update to still share separate packages.

	* a-except.ads, a-except.adb: Ditto.
	Add comments that this version is now used only by the compiler and
	other basic tools. The full version that includes the Ada 2005 stuff
	is in separate files a-except-2005.ads/adb. The reason is that we do
	not want to cause bootstrap problems with compilers not recognizing
	Wide_Wide_String.
	Add exception reason code PE_Implicit_Return
	Add new exception reason code (Null Exception_Id)

	* a-except-2005.adb, a-except-2005.ads: New files.

	* s-wchcon.ads: (Get_WC_Encoding_Method): New function.

	* s-wchcon.adb: New file.

	* Makefile.in (LIBGNAT_SRCS): Add tb-gcc.c.
	(traceback.o deps): Likewise.
	(SPARC/Solaris): Accept sparc[64|v9]-sun-solaris.
	Activate build of GMEM instrumentation library on VMS targets.
	(gnatlib-sjlj, gnatlib-zcx): Pass EH_MECHANISM to make gnatlib.
	Use a-except-2005.ads/adb for all run-time library builds unless
	specified otherwise.
	[VMS] (LIBGNAT_TARGET_PAIRS_AUX1,2): Rename s-parame-vms.ads to
	s-parame-vms-alpha.ads and add s-parame-vms-ia64.ads.
	Use s-parame.adb on all native platforms.
	Use s-parame-vxworks.adb on all vxworks platforms.
	Add env.c env.h in LIBGNAT_SRCS
	Add env.o in LIBGNAT_OBJS
	(GNATMAKE_OBJS): Remove ctrl_c.o object.
	(LIBGNAT_TARGET_PAIRS for x86-vxworks): Use an specialized version of
	s-osinte.adb, s-tpopsp.adb, and system.ads for the run time that
	supports VxWorks 6 RTPs.
	(EXTRA_GNATRTL_NONTASKING_OBJS for x86-vxworks): Remove the use of
	i-vxworks and i-vxwoio from the run time that supports VxWorks 6 RTPs.

	* types.h, types.ads (Terminate_Program): New exception
	Add comment on modifying multiple versions of a-except.adb when the
	table of exception reasons is modified.
	Add exception reason code PE_Implicit_Return
	Add new exception reason code (Null Exception_Id)

        * clean.adb (Initialize): Get the target parameters before checking
        if target is OpenVMS. Move the OpenVMS specific code here from package
        body elaboration code.

From-SVN: r111031
parent 5b47742c
...@@ -35,6 +35,15 @@ ...@@ -35,6 +35,15 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- This version of Ada.Exceptions is a full Ada 95 version, but lacks the
-- additional definitions of Exception_Name returning Wide_[Wide_]String.
-- It is used for building the compiler and the basic tools, since these
-- builds may be done with bootstrap compilers that cannot handle these
-- additions. The full version of Ada.Exceptions can be found in the files
-- a-except-2005.ads/adb, and is used for all other builds where full Ada
-- 2005 functionality is required. in particular, it is used for building
-- run times on all targets.
pragma Polling (Off); pragma Polling (Off);
-- We must turn polling off for this unit, because otherwise we get -- We must turn polling off for this unit, because otherwise we get
-- elaboration circularities with ourself. -- elaboration circularities with ourself.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2006, 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- --
...@@ -532,7 +532,11 @@ package body Exception_Propagation is ...@@ -532,7 +532,11 @@ package body Exception_Propagation is
-- Unwind_RaiseException to actually throw, taking care of handling -- Unwind_RaiseException to actually throw, taking care of handling
-- the two phase scheme it implements. -- the two phase scheme it implements.
procedure Propagate_Exception (From_Signal_Handler : Boolean) is procedure Propagate_Exception
(E : Exception_Id;
From_Signal_Handler : Boolean)
is
pragma Inspection_Point (E);
pragma Unreferenced (From_Signal_Handler); pragma Unreferenced (From_Signal_Handler);
Excep : constant EOA := Get_Current_Excep.all; Excep : constant EOA := Get_Current_Excep.all;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- -- Copyright (C) 1992-2006 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- --
...@@ -69,7 +69,12 @@ package body Exception_Propagation is ...@@ -69,7 +69,12 @@ package body Exception_Propagation is
-- Propagate_Exception -- -- Propagate_Exception --
------------------------- -------------------------
procedure Propagate_Exception (From_Signal_Handler : Boolean) is procedure Propagate_Exception
(E : Exception_Id;
From_Signal_Handler : Boolean)
is
pragma Inspection_Point (E);
Jumpbuf_Ptr : constant Address := Get_Jmpbuf_Address.all; Jumpbuf_Ptr : constant Address := Get_Jmpbuf_Address.all;
Excep : constant EOA := Get_Current_Excep.all; Excep : constant EOA := Get_Current_Excep.all;
begin begin
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2003-2005, Free Software Foundation, Inc. -- -- Copyright (C) 2003-2006, 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- --
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
with ALI; use ALI; with ALI; use ALI;
with Csets; with Csets;
with Gnatvsn; with Gnatvsn; use Gnatvsn;
with Makeutl; with Makeutl;
with MLib.Tgt; use MLib.Tgt; with MLib.Tgt; use MLib.Tgt;
with Namet; use Namet; with Namet; use Namet;
...@@ -1288,8 +1288,11 @@ package body Clean is ...@@ -1288,8 +1288,11 @@ package body Clean is
begin begin
if not Copyright_Displayed then if not Copyright_Displayed then
Copyright_Displayed := True; Copyright_Displayed := True;
Put_Line ("GNATCLEAN " & Gnatvsn.Gnat_Version_String Put_Line
& " Copyright 2003-2005 Free Software Foundation, Inc."); ("GNATCLEAN " & Gnatvsn.Gnat_Version_String
& " Copyright 2003-"
& Current_Year
& " Free Software Foundation, Inc.");
end if; end if;
end Display_Copyright; end Display_Copyright;
...@@ -1308,7 +1311,6 @@ package body Clean is ...@@ -1308,7 +1311,6 @@ package body Clean is
procedure Extract_From_Q (Lib_File : out File_Name_Type) is procedure Extract_From_Q (Lib_File : out File_Name_Type) is
Lib : constant File_Name_Type := Q.Table (Q_Front); Lib : constant File_Name_Type := Q.Table (Q_Front);
begin begin
Q_Front := Q_Front + 1; Q_Front := Q_Front + 1;
Lib_File := Lib; Lib_File := Lib;
...@@ -1501,12 +1503,27 @@ package body Clean is ...@@ -1501,12 +1503,27 @@ package body Clean is
if not Initialized then if not Initialized then
Initialized := True; Initialized := True;
-- Get default search directories to locate system.ads when calling
-- Targparm.Get_Target_Parameters.
Osint.Add_Default_Search_Dirs;
-- Initialize some packages -- Initialize some packages
Csets.Initialize; Csets.Initialize;
Namet.Initialize; Namet.Initialize;
Snames.Initialize; Snames.Initialize;
Prj.Initialize (Project_Tree); Prj.Initialize (Project_Tree);
-- Check if the platform is VMS and, if it is, change some variables
Targparm.Get_Target_Parameters;
if OpenVMS_On_Target then
Debug_Suffix (Debug_Suffix'First) := '_';
Repinfo_Suffix (Repinfo_Suffix'First) := '_';
B_Start := new String'("b__");
end if;
end if; end if;
-- Reset global variables -- Reset global variables
...@@ -1897,11 +1914,4 @@ package body Clean is ...@@ -1897,11 +1914,4 @@ package body Clean is
New_Line; New_Line;
end if; end if;
end Usage; end Usage;
begin
if OpenVMS_On_Target then
Debug_Suffix (Debug_Suffix'First) := '_';
Repinfo_Suffix (Repinfo_Suffix'First) := '_';
B_Start := new String'("b__");
end if;
end Clean; end Clean;
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . W C H _ C O N --
-- --
-- B o d y --
-- --
-- Copyright (C) 2005, 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- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
package body System.WCh_Con is
----------------------------
-- Get_WC_Encoding_Method --
----------------------------
function Get_WC_Encoding_Method (C : Character) return WC_Encoding_Method is
begin
for Method in WC_Encoding_Method loop
if C = WC_Encoding_Letters (Method) then
return Method;
end if;
end loop;
raise Constraint_Error;
end Get_WC_Encoding_Method;
end System.WCh_Con;
...@@ -182,4 +182,8 @@ package System.WCh_Con is ...@@ -182,4 +182,8 @@ package System.WCh_Con is
-- The longest number of characters that can be used for a wide character -- The longest number of characters that can be used for a wide character
-- or wide wide character sequence for any of the active encoding methods. -- or wide wide character sequence for any of the active encoding methods.
function Get_WC_Encoding_Method (C : Character) return WC_Encoding_Method;
-- Given a character C, returns corresponding encoding method (see array
-- WC_Encoding_Letters above). Raises Constraint_Error if not in list.
end System.WCh_Con; end System.WCh_Con;
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2006, 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- --
...@@ -725,7 +725,7 @@ package Types is ...@@ -725,7 +725,7 @@ package Types is
----------------------------------- -----------------------------------
-- This section contains declarations of exceptions that are used -- This section contains declarations of exceptions that are used
-- throughout the compiler. -- throughout the compiler or in other GNAT tools.
Unrecoverable_Error : exception; Unrecoverable_Error : exception;
-- This exception is raised to immediately terminate the compilation -- This exception is raised to immediately terminate the compilation
...@@ -734,6 +734,14 @@ package Types is ...@@ -734,6 +734,14 @@ package Types is
-- reached, or a required file is not found). Also raised when the -- reached, or a required file is not found). Also raised when the
-- compiler finds itself in trouble after an error (see Comperr). -- compiler finds itself in trouble after an error (see Comperr).
Terminate_Program : exception;
-- This exception is raised to immediately terminate the tool being
-- executed. Each tool where this exception may be raised must have
-- a single exception handler that contains only a null statement and
-- that is the last statement of the program. If needed, procedure
-- Set_Exit_Status is called with the appropriate exit status before
-- raising Terminate_Program.
--------------------------------- ---------------------------------
-- Parameter Mechanism Control -- -- Parameter Mechanism Control --
--------------------------------- ---------------------------------
...@@ -774,42 +782,45 @@ package Types is ...@@ -774,42 +782,45 @@ package Types is
-- the definition of last_reason_code. -- the definition of last_reason_code.
-- 3. Add a new routine in Ada.Exceptions with the appropriate call -- 3. Add a new routine in Ada.Exceptions with the appropriate call
-- and static string constant -- and static string constant. Note that there is more than one
-- version of a-except.adb which must be modified.
type RT_Exception_Code is (
CE_Access_Check_Failed, type RT_Exception_Code is
CE_Access_Parameter_Is_Null, (CE_Access_Check_Failed, -- 00
CE_Discriminant_Check_Failed, CE_Access_Parameter_Is_Null, -- 01
CE_Divide_By_Zero, CE_Discriminant_Check_Failed, -- 02
CE_Explicit_Raise, CE_Divide_By_Zero, -- 03
CE_Index_Check_Failed, CE_Explicit_Raise, -- 04
CE_Invalid_Data, CE_Index_Check_Failed, -- 05
CE_Length_Check_Failed, CE_Invalid_Data, -- 06
CE_Null_Not_Allowed, CE_Length_Check_Failed, -- 07
CE_Overflow_Check_Failed, CE_Null_Exception_Id, -- 08
CE_Partition_Check_Failed, CE_Null_Not_Allowed, -- 09
CE_Range_Check_Failed, CE_Overflow_Check_Failed, -- 10
CE_Tag_Check_Failed, CE_Partition_Check_Failed, -- 11
CE_Range_Check_Failed, -- 12
PE_Access_Before_Elaboration, CE_Tag_Check_Failed, -- 13
PE_Accessibility_Check_Failed,
PE_All_Guards_Closed, PE_Access_Before_Elaboration, -- 14
PE_Duplicated_Entry_Address, PE_Accessibility_Check_Failed, -- 15
PE_Explicit_Raise, PE_All_Guards_Closed, -- 16
PE_Finalize_Raised_Exception, PE_Duplicated_Entry_Address, -- 17
PE_Misaligned_Address_Value, PE_Explicit_Raise, -- 18
PE_Missing_Return, PE_Finalize_Raised_Exception, -- 19
PE_Overlaid_Controlled_Object, PE_Implicit_Return, -- 20
PE_Potentially_Blocking_Operation, PE_Misaligned_Address_Value, -- 21
PE_Stubbed_Subprogram_Called, PE_Missing_Return, -- 22
PE_Unchecked_Union_Restriction, PE_Overlaid_Controlled_Object, -- 23
PE_Illegal_RACW_E_4_18, PE_Potentially_Blocking_Operation, -- 24
PE_Stubbed_Subprogram_Called, -- 25
SE_Empty_Storage_Pool, PE_Unchecked_Union_Restriction, -- 26
SE_Explicit_Raise, PE_Illegal_RACW_E_4_18, -- 27
SE_Infinite_Recursion,
SE_Object_Too_Large, SE_Empty_Storage_Pool, -- 28
SE_Restriction_Violation); SE_Explicit_Raise, -- 29
SE_Infinite_Recursion, -- 30
SE_Object_Too_Large, -- 31
SE_Restriction_Violation); -- 32
subtype RT_CE_Exceptions is RT_Exception_Code range subtype RT_CE_Exceptions is RT_Exception_Code range
CE_Access_Check_Failed .. CE_Access_Check_Failed ..
......
...@@ -338,28 +338,32 @@ typedef Int Mechanism_Type; ...@@ -338,28 +338,32 @@ typedef Int Mechanism_Type;
#define CE_Index_Check_Failed 5 #define CE_Index_Check_Failed 5
#define CE_Invalid_Data 6 #define CE_Invalid_Data 6
#define CE_Length_Check_Failed 7 #define CE_Length_Check_Failed 7
#define CE_Null_Not_Allowed 8 #define CE_Null_Exception_Id 9
#define CE_Overflow_Check_Failed 9 #define CE_Null_Not_Allowed 9
#define CE_Partition_Check_Failed 10 #define CE_Overflow_Check_Failed 10
#define CE_Range_Check_Failed 11 #define CE_Partition_Check_Failed 11
#define CE_Tag_Check_Failed 12 #define CE_Range_Check_Failed 12
#define PE_Access_Before_Elaboration 13 #define CE_Tag_Check_Failed 13
#define PE_Accessibility_Check_Failed 14
#define PE_All_Guards_Closed 15 #define PE_Access_Before_Elaboration 14
#define PE_Duplicated_Entry_Address 16 #define PE_Accessibility_Check_Failed 15
#define PE_Explicit_Raise 17 #define PE_All_Guards_Closed 16
#define PE_Finalize_Raised_Exception 18 #define PE_Duplicated_Entry_Address 17
#define PE_Misaligned_Address_Value 19 #define PE_Explicit_Raise 18
#define PE_Missing_Return 20 #define PE_Finalize_Raised_Exception 19
#define PE_Overlaid_Controlled_Object 21 #define PE_Implicit_Return 20
#define PE_Potentially_Blocking_Operation 22 #define PE_Misaligned_Address_Value 21
#define PE_Stubbed_Subprogram_Called 23 #define PE_Missing_Return 22
#define PE_Unchecked_Union_Restriction 24 #define PE_Overlaid_Controlled_Object 23
#define PE_Illegal_RACW_E_4_18 25 #define PE_Potentially_Blocking_Operation 24
#define SE_Empty_Storage_Pool 26 #define PE_Stubbed_Subprogram_Called 25
#define SE_Explicit_Raise 27 #define PE_Unchecked_Union_Restriction 26
#define SE_Infinite_Recursion 28 #define PE_Illegal_RACW_E_4_18 27
#define SE_Object_Too_Large 29
#define SE_Restriction_Violation 30 #define SE_Empty_Storage_Pool 28
#define SE_Explicit_Raise 29
#define LAST_REASON_CODE 30 #define SE_Infinite_Recursion 30
#define SE_Object_Too_Large 31
#define SE_Restriction_Violation 32
#define LAST_REASON_CODE 31
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