Commit 982f26e4 by Arnaud Charlet

a-except.adb (Zero_Cost_Exceptions): Removed, no longer used.

	* a-except.adb (Zero_Cost_Exceptions): Removed, no longer used.
	(builtin_longjmp, Process_Raise_Exceeption): Move setjmp/longjmp
	related code to a-exexpr.adb
	(Save_Occurrence_And_Private): Move GCC EH related code to
	a-exexpr-gcc.adb
	(Raise_Current_Excep): Add new variable Id with pragma
        volatile, to ensure that the variable lives on stack.

	* a-exexpr-gcc.adb, raise-gcc.c: New file.

	* a-exexpr.adb (builtin_longjmp, Propagate_Exception): Moved here code
	from a-except.adb.
	Move GCC EH related code to a-exexpr-gcc.adb

	* Makefile.in: Add or update g-soccon LIBGNAT pairs for Linux/PPC and
	64-bit Solaris
	Split the Linux version of g-soccon into separate variants for 32 and 64
	bit platforms.
	(gnatlib): Use $(AR_FOR_TARGET) and $(RANLIB_FOR_TARGET)
	vice $(AR) and $(RANLIB). Remove use of host variable $(RANLIB_FLAGS).
	install-gnatlib: Use $(RANLIB_FOR_TARGET) vice $(RANLIB). Remove use
	of host variable $(RANLIB_FLAGS).
	(alpha64-dec-*vms*): Fix translations for 64 bit compiler.
	Code clean up: remove unused/obsolete targets.
	(EH_MECHANISM): New variable introduced to differenciate between the
	two EH mechanisms statically.
	(gnatlib-zcx, gnatlib-sjlj): Force EH_MECHANISM manually.
	(LIBGNAT_OBJS): Add raise-gcc.o
	(LIBGNAT_TARGET_PAIRS for ppc-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 ppc-vxworks): Remove the use of
	i-vxworks and i-vxwoio from the run time that supports VxWorks 6 RTPs.

	* raise.c: Move all GCC EH-related routines to raise-gcc.c

From-SVN: r106959
parent c01b085f
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- Copyright (C) 1992-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- --
......@@ -41,23 +41,11 @@ with System.Soft_Links; use System.Soft_Links;
package body Ada.Exceptions is
procedure builtin_longjmp (buffer : Address; Flag : Integer);
pragma No_Return (builtin_longjmp);
pragma Import (C, builtin_longjmp, "_gnat_builtin_longjmp");
pragma Suppress (All_Checks);
-- We definitely do not want exceptions occurring within this unit, or
-- we are in big trouble. If an exceptional situation does occur, better
-- that it not be raised, since raising it can cause confusing chaos.
Zero_Cost_Exceptions : Integer;
pragma Import (C, Zero_Cost_Exceptions, "__gl_zero_cost_exceptions");
-- Boolean indicating if we are handling exceptions using a zero cost
-- mechanism.
--
-- Note that although we currently do not support it, the GCC3 back-end
-- tables are also potentially useable for setjmp/longjmp processing.
-----------------------
-- Local Subprograms --
-----------------------
......@@ -409,12 +397,6 @@ package body Ada.Exceptions is
-- The following procedures provide an internal interface to help making
-- this explicit.
procedure Save_Occurrence_And_Private
(Target : out Exception_Occurrence;
Source : Exception_Occurrence);
-- Copy all the components of Source to Target as well as the
-- Private_Data pointer.
procedure Save_Occurrence_No_Private
(Target : out Exception_Occurrence;
Source : Exception_Occurrence);
......@@ -783,81 +765,15 @@ package body Ada.Exceptions is
is
pragma Inspection_Point (E);
-- This is so the debugger can reliably inspect the parameter
Jumpbuf_Ptr : constant Address := Get_Jmpbuf_Address.all;
Excep : constant EOA := Get_Current_Excep.all;
begin
-- WARNING : There should be no exception handler for this body
-- WARNING: There should be no exception handler for this body
-- because this would cause gigi to prepend a setup for a new
-- jmpbuf to the sequence of statements. We would then always get
-- this new buf in Jumpbuf_Ptr instead of the one for the exception
-- we are handling, which would completely break the whole design
-- of this procedure.
-- Processing varies between zero cost and setjmp/lonjmp processing
if Zero_Cost_Exceptions /= 0 then
-- Use the GCC back-end to propagate the exception. Backtrace
-- computation is performed, if required, by the underlying routine.
-- Notifications for the debugger are also not performed here,
-- because we do not yet know if the exception is handled.
Exception_Propagation.Propagate_Exception (From_Signal_Handler);
else
-- Compute the backtrace for this occurrence if corresponding binder
-- option has been set. Call_Chain takes care of the reraise case.
Call_Chain (Excep);
-- Note on above call to Call_Chain:
-- We used to only do this if From_Signal_Handler was not set,
-- based on the assumption that backtracing from a signal handler
-- would not work due to stack layout oddities. However, since
-- 1. The flag is never set in tasking programs (Notify_Exception
-- performs regular raise statements), and
-- 2. No problem has shown up in tasking programs around here so
-- far, this turned out to be too strong an assumption.
-- As, in addition, the test was
-- 1. preventing the production of backtraces in non-tasking
-- programs, and
-- 2. introducing a behavior inconsistency between
-- the tasking and non-tasking cases,
-- jmpbuf to the sequence of statements in case of built-in sjljl.
-- We would then always get this new buf in Jumpbuf_Ptr instead of the
-- one for the exception we are handling, which would completely break
-- the whole design of this procedure.
-- we have simply removed it
-- If the jump buffer pointer is non-null, transfer control using
-- it. Otherwise announce an unhandled exception (note that this
-- means that we have no finalizations to do other than at the outer
-- level). Perform the necessary notification tasks in both cases.
if Jumpbuf_Ptr /= Null_Address then
if not Excep.Exception_Raised then
Excep.Exception_Raised := True;
Exception_Traces.Notify_Handled_Exception;
end if;
builtin_longjmp (Jumpbuf_Ptr, 1);
else
-- The pragma Inspection point here ensures that the debugger
-- can inspect the parameter.
pragma Inspection_Point (E);
Exception_Traces.Notify_Unhandled_Exception;
Exception_Traces.Unhandled_Exception_Terminate;
end if;
end if;
Exception_Propagation.Propagate_Exception (From_Signal_Handler);
end Process_Raise_Exception;
----------------------------
......@@ -892,8 +808,23 @@ package body Ada.Exceptions is
-------------------------
procedure Raise_Current_Excep (E : Exception_Id) is
pragma Inspection_Point (E);
-- This is so the debugger can reliably inspect the parameter
-- This is so the debugger can reliably inspect the parameter when
-- inserting a breakpoint at the start of this procedure.
Id : Exception_Id := E;
pragma Volatile (Id);
pragma Warnings (Off, Id);
-- In order to provide support for breakpoints on unhandled exceptions,
-- the debugger will also need to be able to inspect the value of E from
-- another (inner) frame. So we need to make sure that if E is passed in
-- a register, its value is also spilled on stack. For this, we store
-- the parameter value in a local variable, and add a pragma Volatile to
-- make sure it is spilled. The pragma Warnings (Off) is needed because
-- the compiler knows that Id is not referenced and that this use of
-- pragma Volatile is peculiar!
begin
Process_Raise_Exception (E => E, From_Signal_Handler => False);
end Raise_Current_Excep;
......@@ -1263,19 +1194,6 @@ package body Ada.Exceptions is
end Save_Occurrence;
--------------------------------
-- Save_Occurrence_And_Private --
--------------------------------
procedure Save_Occurrence_And_Private
(Target : out Exception_Occurrence;
Source : Exception_Occurrence)
is
begin
Save_Occurrence_No_Private (Target, Source);
Target.Private_Data := Source.Private_Data;
end Save_Occurrence_And_Private;
--------------------------------
-- Save_Occurrence_No_Private --
--------------------------------
......
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