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
This commit is contained in:
parent
5b47742c2d
commit
6f301919dc
12 changed files with 2166 additions and 389 deletions
|
@ -302,7 +302,7 @@ GNATLINK_OBJS = gnatlink.o \
|
|||
sdefault.o snames.o stylesw.o switch.o system.o table.o targparm.o tree_io.o \
|
||||
types.o validsw.o widechar.o
|
||||
|
||||
GNATMAKE_OBJS = a-except.o ctrl_c.o ali.o ali-util.o s-casuti.o \
|
||||
GNATMAKE_OBJS = a-except.o ali.o ali-util.o s-casuti.o \
|
||||
alloc.o atree.o binderr.o butil.o casing.o csets.o debug.o elists.o einfo.o\
|
||||
erroutc.o errutil.o err_vars.o fmap.o fname.o fname-uf.o fname-sf.o \
|
||||
gnatmake.o gnatvsn.o hostparm.o interfac.o i-c.o i-cstrin.o krunch.o lib.o \
|
||||
|
@ -399,6 +399,7 @@ ifeq ($(strip $(filter-out m68k% wrs vx%,$(targ))),)
|
|||
s-osinte.ads<s-osinte-vxworks.ads \
|
||||
s-osprim.adb<s-osprim-vxworks.adb \
|
||||
s-parame.ads<s-parame-vxworks.ads \
|
||||
s-parame.adb<s-parame-vxworks.adb \
|
||||
s-stchop.adb<s-stchop-vxworks.adb \
|
||||
s-taprop.adb<s-taprop-vxworks.adb \
|
||||
s-taspri.ads<s-taspri-vxworks.ads \
|
||||
|
@ -435,6 +436,7 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworks,$(targ))),)
|
|||
s-osinte.ads<s-osinte-vxworks.ads \
|
||||
s-osprim.adb<s-osprim-vxworks.adb \
|
||||
s-parame.ads<s-parame-vxworks.ads \
|
||||
s-parame.adb<s-parame-vxworks.adb \
|
||||
s-stchop.adb<s-stchop-vxworks.adb \
|
||||
s-taprop.adb<s-taprop-vxworks.adb \
|
||||
s-taspri.ads<s-taspri-vxworks.ads \
|
||||
|
@ -473,129 +475,6 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworks,$(targ))),)
|
|||
EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(filter-out sparc% wrs vx%,$(targ))),)
|
||||
LIBGNAT_TARGET_PAIRS = \
|
||||
a-intnam.ads<a-intnam-vxworks.ads \
|
||||
a-numaux.ads<a-numaux-vxworks.ads \
|
||||
s-inmaop.adb<s-inmaop-posix.adb \
|
||||
s-interr.adb<s-interr-vxworks.adb \
|
||||
s-intman.ads<s-intman-vxworks.ads \
|
||||
s-intman.adb<s-intman-vxworks.adb \
|
||||
s-osinte.adb<s-osinte-vxworks.adb \
|
||||
s-osinte.ads<s-osinte-vxworks.ads \
|
||||
s-osprim.adb<s-osprim-vxworks.adb \
|
||||
s-parame.ads<s-parame-vxworks.ads \
|
||||
s-stchop.adb<s-stchop-vxworks.adb \
|
||||
s-taprop.adb<s-taprop-vxworks.adb \
|
||||
s-taspri.ads<s-taspri-vxworks.ads \
|
||||
s-tpopsp.adb<s-tpopsp-vxworks.adb \
|
||||
s-vxwork.ads<s-vxwork-sparcv9.ads \
|
||||
g-soccon.ads<g-soccon-vxworks.ads \
|
||||
g-socthi.ads<g-socthi-vxworks.ads \
|
||||
g-socthi.adb<g-socthi-vxworks.adb \
|
||||
system.ads<system-vxworks-sparcv9.ads \
|
||||
|
||||
TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
|
||||
|
||||
EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
|
||||
EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(filter-out %86 wrs vxworks,$(targ))),)
|
||||
LIBGNAT_TARGET_PAIRS = \
|
||||
a-intnam.ads<a-intnam-vxworks.ads \
|
||||
i-vxwork.ads<i-vxwork-x86.ads \
|
||||
s-inmaop.adb<s-inmaop-posix.adb \
|
||||
s-interr.adb<s-interr-vxworks.adb \
|
||||
s-intman.ads<s-intman-vxworks.ads \
|
||||
s-intman.adb<s-intman-vxworks.adb \
|
||||
a-numaux.adb<a-numaux-x86.adb \
|
||||
a-numaux.ads<a-numaux-x86.ads \
|
||||
s-osinte.adb<s-osinte-vxworks.adb \
|
||||
s-osinte.ads<s-osinte-vxworks.ads \
|
||||
s-osprim.adb<s-osprim-vxworks.adb \
|
||||
s-parame.ads<s-parame-vxworks.ads \
|
||||
s-stchop.adb<s-stchop-vxworks.adb \
|
||||
s-taprop.adb<s-taprop-vxworks.adb \
|
||||
s-taspri.ads<s-taspri-vxworks.ads \
|
||||
s-tpopsp.adb<s-tpopsp-vxworks.adb \
|
||||
s-vxwork.ads<s-vxwork-x86.ads \
|
||||
g-soccon.ads<g-soccon-vxworks.ads \
|
||||
g-socthi.ads<g-socthi-vxworks.ads \
|
||||
g-socthi.adb<g-socthi-vxworks.adb \
|
||||
system.ads<system-vxworks-x86.ads
|
||||
|
||||
TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
|
||||
|
||||
ifeq ($(strip $(filter-out yes,$(TRACE))),)
|
||||
LIBGNAT_TARGET_PAIRS += \
|
||||
s-traces.adb<s-traces-default.adb \
|
||||
s-trafor.adb<s-trafor-default.adb \
|
||||
s-trafor.ads<s-trafor-default.ads \
|
||||
s-tratas.adb<s-tratas-default.adb \
|
||||
s-tfsetr.adb<s-tfsetr-vxworks.adb
|
||||
endif
|
||||
|
||||
EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
|
||||
EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(filter-out arm% coff wrs vx%,$(targ))),)
|
||||
LIBGNAT_TARGET_PAIRS = \
|
||||
a-intnam.ads<a-intnam-vxworks.ads \
|
||||
a-numaux.ads<a-numaux-vxworks.ads \
|
||||
s-inmaop.adb<s-inmaop-posix.adb \
|
||||
s-interr.adb<s-interr-vxworks.adb \
|
||||
s-intman.ads<s-intman-vxworks.ads \
|
||||
s-intman.adb<s-intman-vxworks.adb \
|
||||
s-osinte.adb<s-osinte-vxworks.adb \
|
||||
s-osinte.ads<s-osinte-vxworks.ads \
|
||||
s-osprim.adb<s-osprim-vxworks.adb \
|
||||
s-parame.ads<s-parame-vxworks.ads \
|
||||
s-stchop.adb<s-stchop-vxworks.adb \
|
||||
s-taprop.adb<s-taprop-vxworks.adb \
|
||||
s-taspri.ads<s-taspri-vxworks.ads \
|
||||
s-tpopsp.adb<s-tpopsp-vxworks.adb \
|
||||
s-vxwork.ads<s-vxwork-arm.ads \
|
||||
g-soccon.ads<g-soccon-vxworks.ads \
|
||||
g-socthi.ads<g-socthi-vxworks.ads \
|
||||
g-socthi.adb<g-socthi-vxworks.adb \
|
||||
system.ads<system-vxworks-arm.ads
|
||||
|
||||
TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
|
||||
|
||||
EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
|
||||
EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(filter-out mips% wrs vx%,$(targ))),)
|
||||
LIBGNAT_TARGET_PAIRS = \
|
||||
a-intnam.ads<a-intnam-vxworks.ads \
|
||||
a-numaux.ads<a-numaux-vxworks.ads \
|
||||
s-inmaop.adb<s-inmaop-posix.adb \
|
||||
s-interr.adb<s-interr-vxworks.adb \
|
||||
s-intman.ads<s-intman-vxworks.ads \
|
||||
s-intman.adb<s-intman-vxworks.adb \
|
||||
s-osinte.adb<s-osinte-vxworks.adb \
|
||||
s-osinte.ads<s-osinte-vxworks.ads \
|
||||
s-osprim.adb<s-osprim-vxworks.adb \
|
||||
s-parame.ads<s-parame-vxworks.ads \
|
||||
s-stchop.adb<s-stchop-vxworks.adb \
|
||||
s-taprop.adb<s-taprop-vxworks.adb \
|
||||
s-taspri.ads<s-taspri-vxworks.ads \
|
||||
s-tpopsp.adb<s-tpopsp-vxworks.adb \
|
||||
s-vxwork.ads<s-vxwork-mips.ads \
|
||||
g-soccon.ads<g-soccon-vxworks.ads \
|
||||
g-socthi.ads<g-socthi-vxworks.ads \
|
||||
g-socthi.adb<g-socthi-vxworks.adb \
|
||||
system.ads<system-vxworks-mips.ads
|
||||
|
||||
TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
|
||||
|
||||
EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
|
||||
EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
|
||||
endif
|
||||
|
||||
# vxworksae / vxworks 653
|
||||
ifeq ($(strip $(filter-out powerpc% wrs vxworksae,$(targ))),)
|
||||
# target pairs for kernel + vthreads runtime
|
||||
|
@ -615,6 +494,7 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworksae,$(targ))),)
|
|||
s-osinte.ads<s-osinte-vxworks.ads \
|
||||
s-osprim.adb<s-osprim-vxworks.adb \
|
||||
s-parame.ads<s-parame-ae653.ads \
|
||||
s-parame.adb<s-parame-vxworks.adb \
|
||||
s-taprop.adb<s-taprop-vxworks.adb \
|
||||
s-taspri.ads<s-taspri-vxworks.ads \
|
||||
s-tpopsp.adb<s-tpopsp-vxworks.adb \
|
||||
|
@ -646,15 +526,153 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworksae,$(targ))),)
|
|||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(filter-out sparc sun solaris%,$(targ))),)
|
||||
ifeq ($(strip $(filter-out sparc% wrs vx%,$(targ))),)
|
||||
LIBGNAT_TARGET_PAIRS = \
|
||||
a-intnam.ads<a-intnam-vxworks.ads \
|
||||
a-numaux.ads<a-numaux-vxworks.ads \
|
||||
s-inmaop.adb<s-inmaop-posix.adb \
|
||||
s-interr.adb<s-interr-vxworks.adb \
|
||||
s-intman.ads<s-intman-vxworks.ads \
|
||||
s-intman.adb<s-intman-vxworks.adb \
|
||||
s-osinte.adb<s-osinte-vxworks.adb \
|
||||
s-osinte.ads<s-osinte-vxworks.ads \
|
||||
s-osprim.adb<s-osprim-vxworks.adb \
|
||||
s-parame.ads<s-parame-vxworks.ads \
|
||||
s-parame.adb<s-parame-vxworks.adb \
|
||||
s-stchop.adb<s-stchop-vxworks.adb \
|
||||
s-taprop.adb<s-taprop-vxworks.adb \
|
||||
s-taspri.ads<s-taspri-vxworks.ads \
|
||||
s-tpopsp.adb<s-tpopsp-vxworks.adb \
|
||||
s-vxwork.ads<s-vxwork-sparcv9.ads \
|
||||
g-soccon.ads<g-soccon-vxworks.ads \
|
||||
g-socthi.ads<g-socthi-vxworks.ads \
|
||||
g-socthi.adb<g-socthi-vxworks.adb \
|
||||
system.ads<system-vxworks-sparcv9.ads \
|
||||
|
||||
TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
|
||||
|
||||
EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
|
||||
EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(filter-out %86 wrs vxworks,$(targ))),)
|
||||
LIBGNAT_TARGET_PAIRS = \
|
||||
a-intnam.ads<a-intnam-vxworks.ads \
|
||||
i-vxwork.ads<i-vxwork-x86.ads \
|
||||
s-inmaop.adb<s-inmaop-posix.adb \
|
||||
s-interr.adb<s-interr-vxworks.adb \
|
||||
s-intman.ads<s-intman-vxworks.ads \
|
||||
s-intman.adb<s-intman-vxworks.adb \
|
||||
a-numaux.adb<a-numaux-x86.adb \
|
||||
a-numaux.ads<a-numaux-x86.ads \
|
||||
s-osinte.ads<s-osinte-vxworks.ads \
|
||||
s-osprim.adb<s-osprim-vxworks.adb \
|
||||
s-parame.ads<s-parame-vxworks.ads \
|
||||
s-parame.adb<s-parame-vxworks.adb \
|
||||
s-stchop.adb<s-stchop-vxworks.adb \
|
||||
s-taprop.adb<s-taprop-vxworks.adb \
|
||||
s-taspri.ads<s-taspri-vxworks.ads \
|
||||
s-vxwork.ads<s-vxwork-x86.ads \
|
||||
g-soccon.ads<g-soccon-vxworks.ads \
|
||||
g-socthi.ads<g-socthi-vxworks.ads \
|
||||
g-socthi.adb<g-socthi-vxworks.adb
|
||||
|
||||
TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
|
||||
|
||||
ifeq ($(strip $(filter-out yes,$(TRACE))),)
|
||||
LIBGNAT_TARGET_PAIRS += \
|
||||
s-traces.adb<s-traces-default.adb \
|
||||
s-trafor.adb<s-trafor-default.adb \
|
||||
s-trafor.ads<s-trafor-default.ads \
|
||||
s-tratas.adb<s-tratas-default.adb \
|
||||
s-tfsetr.adb<s-tfsetr-vxworks.adb
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(filter-out rtp,$(THREAD_KIND))),)
|
||||
LIBGNAT_TARGET_PAIRS += \
|
||||
s-osinte.adb<s-osinte-vxworks-rtp.adb \
|
||||
s-tpopsp.adb<s-tpopsp-vxworks-rtp.adb \
|
||||
system.ads<system-vxworks-x86-rtp.ads
|
||||
|
||||
EXTRA_GNATRTL_NONTASKING_OBJS=s-vxwexc.o
|
||||
else
|
||||
LIBGNAT_TARGET_PAIRS += \
|
||||
s-osinte.adb<s-osinte-vxworks.adb \
|
||||
s-tpopsp.adb<s-tpopsp-vxworks.adb \
|
||||
system.ads<system-vxworks-x86.ads
|
||||
|
||||
EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
|
||||
endif
|
||||
|
||||
EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(filter-out arm% coff wrs vx%,$(targ))),)
|
||||
LIBGNAT_TARGET_PAIRS = \
|
||||
a-intnam.ads<a-intnam-vxworks.ads \
|
||||
a-numaux.ads<a-numaux-vxworks.ads \
|
||||
s-inmaop.adb<s-inmaop-posix.adb \
|
||||
s-interr.adb<s-interr-vxworks.adb \
|
||||
s-intman.ads<s-intman-vxworks.ads \
|
||||
s-intman.adb<s-intman-vxworks.adb \
|
||||
s-osinte.adb<s-osinte-vxworks.adb \
|
||||
s-osinte.ads<s-osinte-vxworks.ads \
|
||||
s-osprim.adb<s-osprim-vxworks.adb \
|
||||
s-parame.ads<s-parame-vxworks.ads \
|
||||
s-parame.adb<s-parame-vxworks.adb \
|
||||
s-stchop.adb<s-stchop-vxworks.adb \
|
||||
s-taprop.adb<s-taprop-vxworks.adb \
|
||||
s-taspri.ads<s-taspri-vxworks.ads \
|
||||
s-tpopsp.adb<s-tpopsp-vxworks.adb \
|
||||
s-vxwork.ads<s-vxwork-arm.ads \
|
||||
g-soccon.ads<g-soccon-vxworks.ads \
|
||||
g-socthi.ads<g-socthi-vxworks.ads \
|
||||
g-socthi.adb<g-socthi-vxworks.adb \
|
||||
system.ads<system-vxworks-arm.ads
|
||||
|
||||
TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
|
||||
|
||||
EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
|
||||
EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(filter-out mips% wrs vx%,$(targ))),)
|
||||
LIBGNAT_TARGET_PAIRS = \
|
||||
a-intnam.ads<a-intnam-vxworks.ads \
|
||||
a-numaux.ads<a-numaux-vxworks.ads \
|
||||
s-inmaop.adb<s-inmaop-posix.adb \
|
||||
s-interr.adb<s-interr-vxworks.adb \
|
||||
s-intman.ads<s-intman-vxworks.ads \
|
||||
s-intman.adb<s-intman-vxworks.adb \
|
||||
s-osinte.adb<s-osinte-vxworks.adb \
|
||||
s-osinte.ads<s-osinte-vxworks.ads \
|
||||
s-osprim.adb<s-osprim-vxworks.adb \
|
||||
s-parame.ads<s-parame-vxworks.ads \
|
||||
s-parame.adb<s-parame-vxworks.adb \
|
||||
s-stchop.adb<s-stchop-vxworks.adb \
|
||||
s-taprop.adb<s-taprop-vxworks.adb \
|
||||
s-taspri.ads<s-taspri-vxworks.ads \
|
||||
s-tpopsp.adb<s-tpopsp-vxworks.adb \
|
||||
s-vxwork.ads<s-vxwork-mips.ads \
|
||||
g-soccon.ads<g-soccon-vxworks.ads \
|
||||
g-socthi.ads<g-socthi-vxworks.ads \
|
||||
g-socthi.adb<g-socthi-vxworks.adb \
|
||||
system.ads<system-vxworks-mips.ads
|
||||
|
||||
TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
|
||||
|
||||
EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
|
||||
EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(filter-out sparc% sun solaris%,$(targ))),)
|
||||
LIBGNAT_TARGET_PAIRS_32 = \
|
||||
a-intnam.ads<a-intnam-solaris.ads \
|
||||
s-inmaop.adb<s-inmaop-posix.adb \
|
||||
s-intman.adb<s-intman-solaris.adb \
|
||||
s-osinte.adb<s-osinte-solaris.adb \
|
||||
s-osinte.ads<s-osinte-solaris.ads \
|
||||
s-osprim.adb<s-osprim-solaris.adb \
|
||||
s-parame.adb<s-parame-solaris.adb \
|
||||
s-taprop.adb<s-taprop-solaris.adb \
|
||||
s-tasinf.adb<s-tasinf-solaris.adb \
|
||||
s-tasinf.ads<s-tasinf-solaris.ads \
|
||||
|
@ -664,6 +682,28 @@ ifeq ($(strip $(filter-out sparc sun solaris%,$(targ))),)
|
|||
g-soliop.ads<g-soliop-solaris.ads \
|
||||
system.ads<system-solaris-sparc.ads
|
||||
|
||||
LIBGNAT_TARGET_PAIRS_64 = \
|
||||
a-intnam.ads<a-intnam-solaris.ads \
|
||||
s-inmaop.adb<s-inmaop-posix.adb \
|
||||
s-intman.adb<s-intman-solaris.adb \
|
||||
s-osinte.adb<s-osinte-solaris.adb \
|
||||
s-osinte.ads<s-osinte-solaris.ads \
|
||||
s-osprim.adb<s-osprim-solaris.adb \
|
||||
s-taprop.adb<s-taprop-solaris.adb \
|
||||
s-tasinf.adb<s-tasinf-solaris.adb \
|
||||
s-tasinf.ads<s-tasinf-solaris.ads \
|
||||
s-taspri.ads<s-taspri-solaris.ads \
|
||||
s-tpopsp.adb<s-tpopsp-solaris.adb \
|
||||
g-soccon.ads<g-soccon-solaris-64.ads \
|
||||
g-soliop.ads<g-soliop-solaris.ads \
|
||||
system.ads<system-solaris-sparcv9.ads
|
||||
|
||||
ifeq ($(strip $(filter-out sparc sun solaris%,$(targ))),)
|
||||
LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_32)
|
||||
else
|
||||
LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_64)
|
||||
endif
|
||||
|
||||
TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-solaris.adb
|
||||
|
||||
EH_MECHANISM=-gcc
|
||||
|
@ -694,22 +734,7 @@ ifeq ($(strip $(filter-out sparc sun solaris%,$(targ))),)
|
|||
endif
|
||||
|
||||
ifeq ($(strip $(filter-out m64,$(THREAD_KIND))),)
|
||||
LIBGNAT_TARGET_PAIRS = \
|
||||
a-intnam.ads<a-intnam-solaris.ads \
|
||||
s-inmaop.adb<s-inmaop-posix.adb \
|
||||
s-intman.adb<s-intman-solaris.adb \
|
||||
s-osinte.adb<s-osinte-solaris.adb \
|
||||
s-osinte.ads<s-osinte-solaris.ads \
|
||||
s-osprim.adb<s-osprim-solaris.adb \
|
||||
s-parame.adb<s-parame-solaris.adb \
|
||||
s-taprop.adb<s-taprop-solaris.adb \
|
||||
s-tasinf.adb<s-tasinf-solaris.adb \
|
||||
s-tasinf.ads<s-tasinf-solaris.ads \
|
||||
s-taspri.ads<s-taspri-solaris.ads \
|
||||
s-tpopsp.adb<s-tpopsp-solaris.adb \
|
||||
g-soccon.ads<g-soccon-solaris-64.ads \
|
||||
g-soliop.ads<g-soliop-solaris.ads \
|
||||
system.ads<system-solaris-sparcv9.ads
|
||||
LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_64)
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -723,7 +748,6 @@ ifeq ($(strip $(filter-out %86 solaris2%,$(arch) $(osys))),)
|
|||
s-osinte.adb<s-osinte-solaris.adb \
|
||||
s-osinte.ads<s-osinte-solaris.ads \
|
||||
s-osprim.adb<s-osprim-solaris.adb \
|
||||
s-parame.adb<s-parame-solaris.adb \
|
||||
s-taprop.adb<s-taprop-solaris.adb \
|
||||
s-tasinf.adb<s-tasinf-solaris.adb \
|
||||
s-tasinf.ads<s-tasinf-solaris.ads \
|
||||
|
@ -758,7 +782,6 @@ ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),)
|
|||
s-taprop.adb<s-taprop-linux.adb \
|
||||
s-taspri.ads<s-taspri-posix.ads \
|
||||
s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
|
||||
s-parame.adb<s-parame-linux.adb \
|
||||
system.ads<system-linux-x86.ads
|
||||
|
||||
TOOLS_TARGET_PAIRS = \
|
||||
|
@ -811,7 +834,6 @@ ifeq ($(strip $(filter-out s390% linux%,$(arch) $(osys))),)
|
|||
s-taprop.adb<s-taprop-linux.adb \
|
||||
s-taspri.ads<s-taspri-posix.ads \
|
||||
s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
|
||||
s-parame.adb<s-parame-linux.adb \
|
||||
system.ads<system-linux-s390x.ads
|
||||
else
|
||||
LIBGNAT_TARGET_PAIRS = \
|
||||
|
@ -824,7 +846,6 @@ ifeq ($(strip $(filter-out s390% linux%,$(arch) $(osys))),)
|
|||
s-taprop.adb<s-taprop-linux.adb \
|
||||
s-taspri.ads<s-taspri-posix.ads \
|
||||
s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
|
||||
s-parame.adb<s-parame-linux.adb \
|
||||
system.ads<system-linux-s390.ads
|
||||
endif
|
||||
|
||||
|
@ -1055,6 +1076,9 @@ ifeq ($(strip $(filter-out ia64 hp vms% openvms%,$(targ))),)
|
|||
s-osinte.ads<s-osinte-vms-ia64.ads \
|
||||
s-vaflop.adb<s-vaflop-vms-ia64.adb \
|
||||
system.ads<system-vms_64.ads
|
||||
|
||||
LIBGNAT_TARGET_PAIRS_AUX2 = \
|
||||
s-parame.ads<s-parame-vms-ia64.ads
|
||||
else
|
||||
ifeq ($(strip $(filter-out alpha64 dec vms% openvms% alphavms%,$(targ))),)
|
||||
LIBGNAT_TARGET_PAIRS_AUX1 = \
|
||||
|
@ -1067,14 +1091,15 @@ ifeq ($(strip $(filter-out alpha64 dec vms% openvms% alphavms%,$(targ))),)
|
|||
s-osinte.ads<s-osinte-vms.ads \
|
||||
s-vaflop.adb<s-vaflop-vms-alpha.adb \
|
||||
system.ads<system-vms_64.ads
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(filter-out express EXPRESS,$(THREAD_KIND))),)
|
||||
LIBGNAT_TARGET_PAIRS_AUX2 = \
|
||||
s-parame.ads<s-parame-vms-restrict.ads
|
||||
else
|
||||
LIBGNAT_TARGET_PAIRS_AUX2 = \
|
||||
s-parame.ads<s-parame-vms.ads
|
||||
s-parame.ads<s-parame-vms-alpha.ads
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
LIBGNAT_TARGET_PAIRS = \
|
||||
|
@ -1118,6 +1143,8 @@ else
|
|||
symbols-processing.adb<symbols-processing-vms-alpha.adb
|
||||
endif
|
||||
|
||||
|
||||
GMEM_LIB = gmemlib
|
||||
EH_MECHANISM=-gcc
|
||||
GNATLIB_SHARED=gnatlib-shared-vms
|
||||
ifeq ($(strip $(filter-out alpha64 dec vms% openvms% alphavms%,$(targ))),)
|
||||
|
@ -1153,7 +1180,6 @@ ifeq ($(strip $(filter-out cygwin32% mingw32% pe,$(osys))),)
|
|||
s-osprim.adb<s-osprim-mingw.adb \
|
||||
s-taprop.adb<s-taprop-mingw.adb \
|
||||
s-taspri.ads<s-taspri-mingw.ads \
|
||||
s-parame.adb<s-parame-mingw.adb \
|
||||
g-socthi.ads<g-socthi-mingw.ads \
|
||||
g-socthi.adb<g-socthi-mingw.adb \
|
||||
g-soccon.ads<g-soccon-mingw.ads \
|
||||
|
@ -1189,7 +1215,6 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(arch) $(osys))),)
|
|||
s-taprop.adb<s-taprop-linux.adb \
|
||||
s-taspri.ads<s-taspri-posix.ads \
|
||||
s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
|
||||
s-parame.adb<s-parame-linux.adb \
|
||||
system.ads<system-linux-ppc.ads
|
||||
|
||||
TOOLS_TARGET_PAIRS = \
|
||||
|
@ -1215,7 +1240,6 @@ ifeq ($(strip $(filter-out sparc% linux%,$(arch) $(osys))),)
|
|||
s-taprop.adb<s-taprop-linux.adb \
|
||||
s-taspri.ads<s-taspri-posix.ads \
|
||||
s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
|
||||
s-parame.adb<s-parame-linux.adb \
|
||||
system.ads<system-linux-sparc.ads
|
||||
|
||||
TOOLS_TARGET_PAIRS = \
|
||||
|
@ -1241,7 +1265,6 @@ ifeq ($(strip $(filter-out hppa% linux%,$(arch) $(osys))),)
|
|||
s-taprop.adb<s-taprop-linux.adb \
|
||||
s-taspri.ads<s-taspri-posix.ads \
|
||||
s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
|
||||
s-parame.adb<s-parame-linux.adb \
|
||||
system.ads<system-linux-hppa.ads
|
||||
|
||||
TOOLS_TARGET_PAIRS = \
|
||||
|
@ -1372,6 +1395,18 @@ ifneq ($(EH_MECHANISM),)
|
|||
EXTRA_LIBGNAT_OBJS+=raise$(EH_MECHANISM).o
|
||||
endif
|
||||
|
||||
# Use the Ada 2005 version of Ada.Exceptions by default, unless specified
|
||||
# explicitely already. The base files (a-except.ad?) are used only for building
|
||||
# the compiler and other basic tools.
|
||||
# These base versions lack Ada 2005 additions which would cause bootstrap
|
||||
# problems if included in the compiler and other basic tools.
|
||||
|
||||
ifeq ($(filter-out a-except%,$(LIBGNAT_TARGET_PAIRS)),$(LIBGNAT_TARGET_PAIRS))
|
||||
LIBGNAT_TARGET_PAIRS += \
|
||||
a-except.ads<a-except-2005.ads \
|
||||
a-except.adb<a-except-2005.adb
|
||||
endif
|
||||
|
||||
# The runtime library for gnat comprises two directories. One contains the
|
||||
# Ada source files that the compiler (gnat1) needs -- these files are listed
|
||||
# by ADA_INCLUDE_SRCS -- and the other contains the object files and their
|
||||
|
@ -1382,12 +1417,12 @@ endif
|
|||
# go into the directory. The pthreads emulation is built in the threads
|
||||
# subdirectory and copied.
|
||||
LIBGNAT_SRCS = ada.h adaint.c adaint.h argv.c cio.c cstreams.c \
|
||||
errno.c exit.c cal.c ctrl_c.c \
|
||||
errno.c exit.c cal.c ctrl_c.c env.c env.h \
|
||||
raise.h raise.c sysdep.c aux-io.c init.c initialize.c seh_init.c \
|
||||
final.c tracebak.c tb-alvms.c tb-alvxw.c expect.c mkdir.c socket.c gsocket.h \
|
||||
targext.c $(EXTRA_LIBGNAT_SRCS)
|
||||
final.c tracebak.c tb-alvms.c tb-alvxw.c tb-gcc.c expect.c mkdir.c \
|
||||
socket.c gsocket.h targext.c $(EXTRA_LIBGNAT_SRCS)
|
||||
|
||||
LIBGNAT_OBJS = adaint.o argv.o cio.o cstreams.o ctrl_c.o errno.o exit.o \
|
||||
LIBGNAT_OBJS = adaint.o argv.o cio.o cstreams.o ctrl_c.o errno.o exit.o env.o \
|
||||
raise.o sysdep.o aux-io.o init.o initialize.o seh_init.o cal.o \
|
||||
final.o tracebak.o expect.o mkdir.o socket.o targext.o $(EXTRA_LIBGNAT_OBJS)
|
||||
|
||||
|
@ -1811,7 +1846,8 @@ gnatlib-sjlj:
|
|||
sed -e 's/ZCX_By_Default.*/ZCX_By_Default : constant Boolean := False;/' rts/system.ads > rts/s.ads
|
||||
$(MV) rts/s.ads rts/system.ads
|
||||
$(MAKE) $(FLAGS_TO_PASS) \
|
||||
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
|
||||
EH_MECHANISM="" \
|
||||
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
|
||||
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
|
||||
THREAD_KIND="$(THREAD_KIND)" \
|
||||
TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
|
||||
|
@ -1821,6 +1857,7 @@ gnatlib-zcx:
|
|||
sed -e 's/ZCX_By_Default.*/ZCX_By_Default : constant Boolean := True;/' rts/system.ads > rts/s.ads
|
||||
$(MV) rts/s.ads rts/system.ads
|
||||
$(MAKE) $(FLAGS_TO_PASS) \
|
||||
EH_MECHANISM="-gcc" \
|
||||
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
|
||||
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
|
||||
THREAD_KIND="$(THREAD_KIND)" \
|
||||
|
@ -1935,7 +1972,7 @@ seh_init.o : seh_init.c raise.h
|
|||
|
||||
# Need to keep the frame pointer in this file to pop the stack properly on
|
||||
# some targets.
|
||||
tracebak.o : tracebak.c tb-alvms.c tb-alvxw.c
|
||||
tracebak.o : tracebak.c tb-alvms.c tb-alvxw.c tb-gcc.c
|
||||
$(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
|
||||
-fno-omit-frame-pointer $< $(OUTPUT_OPTION)
|
||||
|
||||
|
|
1355
gcc/ada/a-except-2005.adb
Normal file
1355
gcc/ada/a-except-2005.adb
Normal file
File diff suppressed because it is too large
Load diff
335
gcc/ada/a-except-2005.ads
Normal file
335
gcc/ada/a-except-2005.ads
Normal file
|
@ -0,0 +1,335 @@
|
|||
------------------------------------------------------------------------------
|
||||
-- --
|
||||
-- GNAT RUN-TIME COMPONENTS --
|
||||
-- --
|
||||
-- A D A . E X C E P T I O N S --
|
||||
-- --
|
||||
-- S p e c --
|
||||
-- --
|
||||
-- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
|
||||
-- --
|
||||
-- This specification is derived from the Ada Reference Manual for use with --
|
||||
-- GNAT. The copyright notice above, and the license provisions that follow --
|
||||
-- apply solely to the contents of the part following the private keyword. --
|
||||
-- --
|
||||
-- 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. --
|
||||
-- --
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
-- This version is used for all Ada 2005 builds. It differs from a-except.ads
|
||||
-- only with respect to the addition of Wide_[Wide]Exception_Name functions.
|
||||
-- The additional entities are marked with pragma Ada_05, so this extended
|
||||
-- unit is also perfectly suitable for use in Ada 95 or Ada 83 mode.
|
||||
|
||||
-- The reason for this splitting off of a separate version is that bootstrap
|
||||
-- compilers often will be used that do not support Ada 2005 features, and
|
||||
-- Ada.Exceptions is part of the compiler sources.
|
||||
|
||||
-- The base version of this unit Ada.Exceptions omits the Wide version of
|
||||
-- Exception_Name and is used to build the compiler and other basic tools.
|
||||
|
||||
pragma Polling (Off);
|
||||
-- We must turn polling off for this unit, because otherwise we get
|
||||
-- elaboration circularities with ourself.
|
||||
|
||||
with System;
|
||||
with System.Parameters;
|
||||
with System.Standard_Library;
|
||||
with System.Traceback_Entries;
|
||||
|
||||
package Ada.Exceptions is
|
||||
pragma Warnings (Off);
|
||||
pragma Preelaborate_05;
|
||||
pragma Warnings (On);
|
||||
-- In accordance with Ada 2005 AI-362. The warnings pragmas are so that we
|
||||
-- can compile this using older compiler versions, which will ignore the
|
||||
-- pragma, which is fine for the bootstrap.
|
||||
|
||||
type Exception_Id is private;
|
||||
Null_Id : constant Exception_Id;
|
||||
|
||||
type Exception_Occurrence is limited private;
|
||||
type Exception_Occurrence_Access is access all Exception_Occurrence;
|
||||
|
||||
Null_Occurrence : constant Exception_Occurrence;
|
||||
|
||||
function Exception_Name (Id : Exception_Id) return String;
|
||||
|
||||
function Exception_Name (X : Exception_Occurrence) return String;
|
||||
|
||||
function Wide_Exception_Name
|
||||
(Id : Exception_Id) return Wide_String;
|
||||
pragma Ada_05 (Wide_Exception_Name);
|
||||
|
||||
function Wide_Exception_Name
|
||||
(X : Exception_Occurrence) return Wide_String;
|
||||
pragma Ada_05 (Wide_Exception_Name);
|
||||
|
||||
function Wide_Wide_Exception_Name
|
||||
(Id : Exception_Id) return Wide_Wide_String;
|
||||
pragma Ada_05 (Wide_Wide_Exception_Name);
|
||||
|
||||
function Wide_Wide_Exception_Name
|
||||
(X : Exception_Occurrence) return Wide_Wide_String;
|
||||
pragma Ada_05 (Wide_Wide_Exception_Name);
|
||||
|
||||
procedure Raise_Exception (E : Exception_Id; Message : String := "");
|
||||
-- Note: it would be really nice to give a pragma No_Return for this
|
||||
-- procedure, but it would be wrong, since Raise_Exception does return
|
||||
-- if given the null exception. However we do special case the name in
|
||||
-- the test in the compiler for issuing a warning for a missing return
|
||||
-- after this call. Program_Error seems reasonable enough in such a case.
|
||||
-- See also the routine Raise_Exception_Always in the private part.
|
||||
|
||||
function Exception_Message (X : Exception_Occurrence) return String;
|
||||
|
||||
procedure Reraise_Occurrence (X : Exception_Occurrence);
|
||||
-- Note: it would be really nice to give a pragma No_Return for this
|
||||
-- procedure, but it would be wrong, since Reraise_Occurrence does return
|
||||
-- if the argument is the null exception occurrence. See also procedure
|
||||
-- Reraise_Occurrence_Always in the private part of this package.
|
||||
|
||||
function Exception_Identity (X : Exception_Occurrence) return Exception_Id;
|
||||
|
||||
function Exception_Information (X : Exception_Occurrence) return String;
|
||||
-- The format of the exception information is as follows:
|
||||
--
|
||||
-- exception name (as in Exception_Name)
|
||||
-- message (or a null line if no message)
|
||||
-- PID=nnnn
|
||||
-- 0xyyyyyyyy 0xyyyyyyyy ...
|
||||
--
|
||||
-- The lines are separated by a ASCII.LF character
|
||||
-- The nnnn is the partition Id given as decimal digits.
|
||||
-- The 0x... line represents traceback program counter locations,
|
||||
-- in order with the first one being the exception location.
|
||||
|
||||
-- Note on ordering: the compiler uses the Save_Occurrence procedure, but
|
||||
-- not the function from Rtsfind, so it is important that the procedure
|
||||
-- come first, since Rtsfind finds the first matching entity.
|
||||
|
||||
procedure Save_Occurrence
|
||||
(Target : out Exception_Occurrence;
|
||||
Source : Exception_Occurrence);
|
||||
|
||||
function Save_Occurrence
|
||||
(Source : Exception_Occurrence)
|
||||
return Exception_Occurrence_Access;
|
||||
|
||||
private
|
||||
package SSL renames System.Standard_Library;
|
||||
package SP renames System.Parameters;
|
||||
|
||||
subtype EOA is Exception_Occurrence_Access;
|
||||
|
||||
Exception_Msg_Max_Length : constant := SP.Default_Exception_Msg_Max_Length;
|
||||
|
||||
------------------
|
||||
-- Exception_Id --
|
||||
------------------
|
||||
|
||||
subtype Code_Loc is System.Address;
|
||||
-- Code location used in building exception tables and for call addresses
|
||||
-- when propagating an exception. Values of this type are created by using
|
||||
-- Label'Address or extracted from machine states using Get_Code_Loc.
|
||||
|
||||
Null_Loc : constant Code_Loc := System.Null_Address;
|
||||
-- Null code location, used to flag outer level frame
|
||||
|
||||
type Exception_Id is new SSL.Exception_Data_Ptr;
|
||||
|
||||
function EId_To_String (X : Exception_Id) return String;
|
||||
function String_To_EId (S : String) return Exception_Id;
|
||||
pragma Stream_Convert (Exception_Id, String_To_EId, EId_To_String);
|
||||
-- Functions for implementing Exception_Id stream attributes
|
||||
|
||||
Null_Id : constant Exception_Id := null;
|
||||
|
||||
-------------------------
|
||||
-- Private Subprograms --
|
||||
-------------------------
|
||||
|
||||
function Current_Target_Exception return Exception_Occurrence;
|
||||
pragma Export
|
||||
(Ada, Current_Target_Exception,
|
||||
"__gnat_current_target_exception");
|
||||
-- This routine should return the current raised exception on targets
|
||||
-- which have built-in exception handling such as the Java Virtual
|
||||
-- Machine. For other targets this routine is simply ignored. Currently,
|
||||
-- only JGNAT uses this. See 4jexcept.ads for details. The pragma Export
|
||||
-- allows this routine to be accessed elsewhere in the run-time, even
|
||||
-- though it is in the private part of this package (it is not allowed
|
||||
-- to be in the visible part, since this is set by the reference manual).
|
||||
|
||||
function Exception_Name_Simple (X : Exception_Occurrence) return String;
|
||||
-- Like Exception_Name, but returns the simple non-qualified name of the
|
||||
-- exception. This is used to implement the Exception_Name function in
|
||||
-- Current_Exceptions (the DEC compatible unit). It is called from the
|
||||
-- compiler generated code (using Rtsfind, which does not respect the
|
||||
-- private barrier, so we can place this function in the private part
|
||||
-- where the compiler can find it, but the spec is unchanged.)
|
||||
|
||||
procedure Raise_Exception_Always (E : Exception_Id; Message : String := "");
|
||||
pragma No_Return (Raise_Exception_Always);
|
||||
pragma Export (Ada, Raise_Exception_Always, "__gnat_raise_exception");
|
||||
-- This differs from Raise_Exception only in that the caller has determined
|
||||
-- that for sure the parameter E is not null, and that therefore the call
|
||||
-- to this procedure cannot return. The expander converts Raise_Exception
|
||||
-- calls to Raise_Exception_Always if it can determine this is the case.
|
||||
-- The Export allows this routine to be accessed from Pure units.
|
||||
|
||||
procedure Raise_From_Signal_Handler
|
||||
(E : Exception_Id;
|
||||
M : System.Address);
|
||||
pragma Export
|
||||
(Ada, Raise_From_Signal_Handler,
|
||||
"ada__exceptions__raise_from_signal_handler");
|
||||
pragma No_Return (Raise_From_Signal_Handler);
|
||||
-- This routine is used to raise an exception from a signal handler. The
|
||||
-- signal handler has already stored the machine state (i.e. the state that
|
||||
-- corresponds to the location at which the signal was raised). E is the
|
||||
-- Exception_Id specifying what exception is being raised, and M is a
|
||||
-- pointer to a null-terminated string which is the message to be raised.
|
||||
-- Note that this routine never returns, so it is permissible to simply
|
||||
-- jump to this routine, rather than call it. This may be appropriate for
|
||||
-- systems where the right way to get out of signal handler is to alter the
|
||||
-- PC value in the machine state or in some other way ask the operating
|
||||
-- system to return here rather than to the original location.
|
||||
|
||||
procedure Reraise_Occurrence_Always (X : Exception_Occurrence);
|
||||
pragma No_Return (Reraise_Occurrence_Always);
|
||||
-- This differs from Raise_Occurrence only in that the caller guarantees
|
||||
-- that for sure the parameter X is not the null occurrence, and that
|
||||
-- therefore this procedure cannot return. The expander uses this routine
|
||||
-- in the translation of a raise statement with no parameter (reraise).
|
||||
|
||||
procedure Reraise_Occurrence_No_Defer (X : Exception_Occurrence);
|
||||
pragma No_Return (Reraise_Occurrence_No_Defer);
|
||||
-- Exactly like Reraise_Occurrence, except that abort is not deferred
|
||||
-- before the call and the parameter X is known not to be the null
|
||||
-- occurrence. This is used in generated code when it is known that
|
||||
-- abort is already deferred.
|
||||
|
||||
-----------------------
|
||||
-- Polling Interface --
|
||||
-----------------------
|
||||
|
||||
-- The GNAT compiler has an option to generate polling calls to the Poll
|
||||
-- routine in this package. Specifying the -gnatP option for a compilation
|
||||
-- causes a call to Ada.Exceptions.Poll to be generated on every subprogram
|
||||
-- entry and on every iteration of a loop, thus avoiding the possibility of
|
||||
-- a case of unbounded time between calls.
|
||||
|
||||
-- This polling interface may be used for instrumentation or debugging
|
||||
-- purposes (e.g. implementing watchpoints in software or in the debugger).
|
||||
|
||||
-- In the GNAT technology itself, this interface is used to implement
|
||||
-- immediate aynschronous transfer of control and immediate abort on
|
||||
-- targets which do not provide for one thread interrupting another.
|
||||
|
||||
-- Note: this used to be in a separate unit called System.Poll, but that
|
||||
-- caused horrible circular elaboration problems between System.Poll and
|
||||
-- Ada.Exceptions. One way of solving such circularities is unification!
|
||||
|
||||
procedure Poll;
|
||||
-- Check for asynchronous abort. Note that we do not inline the body.
|
||||
-- This makes the interface more useful for debugging purposes.
|
||||
|
||||
--------------------------
|
||||
-- Exception_Occurrence --
|
||||
--------------------------
|
||||
|
||||
package TBE renames System.Traceback_Entries;
|
||||
|
||||
Max_Tracebacks : constant := 50;
|
||||
-- Maximum number of trace backs stored in exception occurrence
|
||||
|
||||
type Tracebacks_Array is array (1 .. Max_Tracebacks) of TBE.Traceback_Entry;
|
||||
-- Traceback array stored in exception occurrence
|
||||
|
||||
type Exception_Occurrence is record
|
||||
Id : Exception_Id;
|
||||
-- Exception_Identity for this exception occurrence
|
||||
-- WARNING System.System.Finalization_Implementation.Finalize_List
|
||||
-- relies on the fact that this field is always first in the exception
|
||||
-- occurrence
|
||||
|
||||
Msg_Length : Natural := 0;
|
||||
-- Length of message (zero = no message)
|
||||
|
||||
Msg : String (1 .. Exception_Msg_Max_Length);
|
||||
-- Characters of message
|
||||
|
||||
Cleanup_Flag : Boolean := False;
|
||||
-- The cleanup flag is normally False, it is set True for an exception
|
||||
-- occurrence passed to a cleanup routine, and will still be set True
|
||||
-- when the cleanup routine does a Reraise_Occurrence call using this
|
||||
-- exception occurrence. This is used to avoid recording a bogus trace
|
||||
-- back entry from this reraise call.
|
||||
|
||||
Exception_Raised : Boolean := False;
|
||||
-- Set to true to indicate that this exception occurrence has actually
|
||||
-- been raised. When an exception occurrence is first created, this is
|
||||
-- set to False, then when it is processed by Raise_Current_Exception,
|
||||
-- it is set to True. If Raise_Current_Exception is used to raise an
|
||||
-- exception for which this flag is already True, then it knows that
|
||||
-- it is dealing with the reraise case (which is useful to distinguish
|
||||
-- for exception tracing purposes).
|
||||
|
||||
Pid : Natural := 0;
|
||||
-- Partition_Id for partition raising exception
|
||||
|
||||
Num_Tracebacks : Natural range 0 .. Max_Tracebacks := 0;
|
||||
-- Number of traceback entries stored
|
||||
|
||||
Tracebacks : Tracebacks_Array;
|
||||
-- Stored tracebacks (in Tracebacks (1 .. Num_Tracebacks))
|
||||
|
||||
Private_Data : System.Address := System.Null_Address;
|
||||
-- Field used by low level exception mechanism to store specific data.
|
||||
-- Currently used by the GCC exception mechanism to store a pointer to
|
||||
-- a GNAT_GCC_Exception.
|
||||
end record;
|
||||
|
||||
function "=" (Left, Right : Exception_Occurrence) return Boolean
|
||||
is abstract;
|
||||
-- Don't allow comparison on exception occurrences, we should not need
|
||||
-- this, and it would not work right, because of the Msg and Tracebacks
|
||||
-- fields which have unused entries not copied by Save_Occurrence.
|
||||
|
||||
function EO_To_String (X : Exception_Occurrence) return String;
|
||||
function String_To_EO (S : String) return Exception_Occurrence;
|
||||
pragma Stream_Convert (Exception_Occurrence, String_To_EO, EO_To_String);
|
||||
-- Functions for implementing Exception_Occurrence stream attributes
|
||||
|
||||
Null_Occurrence : constant Exception_Occurrence := (
|
||||
Id => null,
|
||||
Msg_Length => 0,
|
||||
Msg => (others => ' '),
|
||||
Cleanup_Flag => False,
|
||||
Exception_Raised => False,
|
||||
Pid => 0,
|
||||
Num_Tracebacks => 0,
|
||||
Tracebacks => (others => TBE.Null_TB_Entry),
|
||||
Private_Data => System.Null_Address);
|
||||
|
||||
end Ada.Exceptions;
|
|
@ -6,7 +6,7 @@
|
|||
-- --
|
||||
-- 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 --
|
||||
-- terms of the GNU General Public License as published by the Free Soft- --
|
||||
|
@ -31,6 +31,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);
|
||||
-- We must turn polling off for this unit, because otherwise we get
|
||||
-- elaboration circularities with System.Exception_Tables.
|
||||
|
@ -54,45 +63,11 @@ package body Ada.Exceptions is
|
|||
-- from C clients using the given external name, even though they are not
|
||||
-- technically visible in the Ada sense.
|
||||
|
||||
function Code_Address_For_AAA return System.Address;
|
||||
function Code_Address_For_ZZZ return System.Address;
|
||||
-- Return start and end of procedures in this package
|
||||
--
|
||||
-- These procedures are used to provide exclusion bounds in
|
||||
-- calls to Call_Chain at exception raise points from this unit. The
|
||||
-- purpose is to arrange for the exception tracebacks not to include
|
||||
-- frames from routines involved in the raise process, as these are
|
||||
-- meaningless from the user's standpoint.
|
||||
--
|
||||
-- For these bounds to be meaningful, we need to ensure that the object
|
||||
-- code for the routines involved in processing a raise is located after
|
||||
-- the object code Code_Address_For_AAA and before the object code
|
||||
-- Code_Address_For_ZZZ. This will indeed be the case as long as the
|
||||
-- following rules are respected:
|
||||
--
|
||||
-- 1) The bodies of the subprograms involved in processing a raise
|
||||
-- are located after the body of Code_Address_For_AAA and before the
|
||||
-- body of Code_Address_For_ZZZ.
|
||||
--
|
||||
-- 2) No pragma Inline applies to any of these subprograms, as this
|
||||
-- could delay the corresponding assembly output until the end of
|
||||
-- the unit.
|
||||
|
||||
procedure Call_Chain (Excep : EOA);
|
||||
-- Store up to Max_Tracebacks in Excep, corresponding to the current
|
||||
-- call chain.
|
||||
|
||||
procedure Process_Raise_Exception
|
||||
(E : Exception_Id;
|
||||
From_Signal_Handler : Boolean);
|
||||
procedure Process_Raise_Exception (E : Exception_Id);
|
||||
pragma No_Return (Process_Raise_Exception);
|
||||
-- This is the lowest level raise routine. It raises the exception
|
||||
-- referenced by Current_Excep.all in the TSD, without deferring abort
|
||||
-- (the caller must ensure that abort is deferred on entry).
|
||||
--
|
||||
-- This is the common implementation for Raise_Current_Excep and
|
||||
-- Raise_From_Signal_Handler. The origin of the call is indicated by the
|
||||
-- From_Signal_Handler argument.
|
||||
|
||||
procedure To_Stderr (S : String);
|
||||
pragma Export (Ada, To_Stderr, "__gnat_to_stderr");
|
||||
|
@ -227,34 +202,11 @@ package body Ada.Exceptions is
|
|||
|
||||
package Exception_Propagation is
|
||||
|
||||
use Exception_Traces;
|
||||
-- Imports Notify_Unhandled_Exception and
|
||||
-- Unhandled_Exception_Terminate
|
||||
|
||||
------------------------------------
|
||||
-- Exception propagation routines --
|
||||
------------------------------------
|
||||
|
||||
procedure Setup_Exception
|
||||
(Excep : EOA;
|
||||
Current : EOA;
|
||||
Reraised : Boolean := False);
|
||||
-- Perform the necessary operations to prepare the propagation of Excep
|
||||
-- in a task where Current is the current occurrence. Excep is assumed
|
||||
-- to be a valid (non null) pointer.
|
||||
--
|
||||
-- This should be called before any (re-)setting of the current
|
||||
-- occurrence. Any such (re-)setting shall take care *not* to clobber
|
||||
-- the Private_Data component.
|
||||
--
|
||||
-- Having Current provided as an argument (instead of retrieving it via
|
||||
-- Get_Current_Excep internally) is required to allow one task to setup
|
||||
-- an exception for another task, which is used by Transfer_Occurrence.
|
||||
|
||||
procedure Propagate_Exception (From_Signal_Handler : Boolean);
|
||||
pragma No_Return (Propagate_Exception);
|
||||
-- This procedure propagates the exception represented by the occurrence
|
||||
-- referenced by Current_Excep in the TSD for the current task.
|
||||
-- Dummy routine used to share a-exexda.adb, do nothing.
|
||||
|
||||
end Exception_Propagation;
|
||||
|
||||
|
@ -278,8 +230,7 @@ package body Ada.Exceptions is
|
|||
procedure Raise_Current_Excep (E : Exception_Id);
|
||||
pragma No_Return (Raise_Current_Excep);
|
||||
pragma Export (C, Raise_Current_Excep, "__gnat_raise_nodefer_with_msg");
|
||||
-- This is a simple wrapper to Process_Raise_Exception setting the
|
||||
-- From_Signal_Handler argument to False.
|
||||
-- This is a simple wrapper to Process_Raise_Exception.
|
||||
--
|
||||
-- This external name for Raise_Current_Excep is historical, and probably
|
||||
-- should be changed but for now we keep it, because gdb and gigi know
|
||||
|
@ -453,6 +404,8 @@ package body Ada.Exceptions is
|
|||
procedure Rcheck_28 (File : System.Address; Line : Integer);
|
||||
procedure Rcheck_29 (File : System.Address; Line : Integer);
|
||||
procedure Rcheck_30 (File : System.Address; Line : Integer);
|
||||
procedure Rcheck_31 (File : System.Address; Line : Integer);
|
||||
procedure Rcheck_32 (File : System.Address; Line : Integer);
|
||||
|
||||
pragma Export (C, Rcheck_00, "__gnat_rcheck_00");
|
||||
pragma Export (C, Rcheck_01, "__gnat_rcheck_01");
|
||||
|
@ -485,6 +438,8 @@ package body Ada.Exceptions is
|
|||
pragma Export (C, Rcheck_28, "__gnat_rcheck_28");
|
||||
pragma Export (C, Rcheck_29, "__gnat_rcheck_29");
|
||||
pragma Export (C, Rcheck_30, "__gnat_rcheck_30");
|
||||
pragma Export (C, Rcheck_31, "__gnat_rcheck_31");
|
||||
pragma Export (C, Rcheck_32, "__gnat_rcheck_32");
|
||||
|
||||
-- None of these procedures ever returns (they raise an exception!). By
|
||||
-- using pragma No_Return, we ensure that any junk code after the call,
|
||||
|
@ -521,6 +476,7 @@ package body Ada.Exceptions is
|
|||
pragma No_Return (Rcheck_28);
|
||||
pragma No_Return (Rcheck_29);
|
||||
pragma No_Return (Rcheck_30);
|
||||
pragma No_Return (Rcheck_32);
|
||||
|
||||
---------------------------------------------
|
||||
-- Reason Strings for Run-Time Check Calls --
|
||||
|
@ -539,30 +495,32 @@ package body Ada.Exceptions is
|
|||
Rmsg_05 : constant String := "index check failed" & NUL;
|
||||
Rmsg_06 : constant String := "invalid data" & NUL;
|
||||
Rmsg_07 : constant String := "length check failed" & NUL;
|
||||
Rmsg_08 : constant String := "null-exclusion check failed" & NUL;
|
||||
Rmsg_09 : constant String := "overflow check failed" & NUL;
|
||||
Rmsg_10 : constant String := "partition check failed" & NUL;
|
||||
Rmsg_11 : constant String := "range check failed" & NUL;
|
||||
Rmsg_12 : constant String := "tag check failed" & NUL;
|
||||
Rmsg_13 : constant String := "access before elaboration" & NUL;
|
||||
Rmsg_14 : constant String := "accessibility check failed" & NUL;
|
||||
Rmsg_15 : constant String := "all guards closed" & NUL;
|
||||
Rmsg_16 : constant String := "duplicated entry address" & NUL;
|
||||
Rmsg_17 : constant String := "explicit raise" & NUL;
|
||||
Rmsg_18 : constant String := "finalize/adjust raised exception" & NUL;
|
||||
Rmsg_19 : constant String := "misaligned address value" & NUL;
|
||||
Rmsg_20 : constant String := "missing return" & NUL;
|
||||
Rmsg_21 : constant String := "overlaid controlled object" & NUL;
|
||||
Rmsg_22 : constant String := "potentially blocking operation" & NUL;
|
||||
Rmsg_23 : constant String := "stubbed subprogram called" & NUL;
|
||||
Rmsg_24 : constant String := "unchecked union restriction" & NUL;
|
||||
Rmsg_25 : constant String := "illegal use of"
|
||||
& " remote access-to-class-wide type, see RM E.4(18)" & NUL;
|
||||
Rmsg_26 : constant String := "empty storage pool" & NUL;
|
||||
Rmsg_27 : constant String := "explicit raise" & NUL;
|
||||
Rmsg_28 : constant String := "infinite recursion" & NUL;
|
||||
Rmsg_29 : constant String := "object too large" & NUL;
|
||||
Rmsg_30 : constant String := "restriction violation" & NUL;
|
||||
Rmsg_08 : constant String := "null Exception_Id" & NUL;
|
||||
Rmsg_09 : constant String := "null-exclusion check failed" & NUL;
|
||||
Rmsg_10 : constant String := "overflow check failed" & NUL;
|
||||
Rmsg_11 : constant String := "partition check failed" & NUL;
|
||||
Rmsg_12 : constant String := "range check failed" & NUL;
|
||||
Rmsg_13 : constant String := "tag check failed" & NUL;
|
||||
Rmsg_14 : constant String := "access before elaboration" & NUL;
|
||||
Rmsg_15 : constant String := "accessibility check failed" & NUL;
|
||||
Rmsg_16 : constant String := "all guards closed" & NUL;
|
||||
Rmsg_17 : constant String := "duplicated entry address" & NUL;
|
||||
Rmsg_18 : constant String := "explicit raise" & NUL;
|
||||
Rmsg_19 : constant String := "finalize/adjust raised exception" & NUL;
|
||||
Rmsg_20 : constant String := "implicit return with No_Return" & NUL;
|
||||
Rmsg_21 : constant String := "misaligned address value" & NUL;
|
||||
Rmsg_22 : constant String := "missing return" & NUL;
|
||||
Rmsg_23 : constant String := "overlaid controlled object" & NUL;
|
||||
Rmsg_24 : constant String := "potentially blocking operation" & NUL;
|
||||
Rmsg_25 : constant String := "stubbed subprogram called" & NUL;
|
||||
Rmsg_26 : constant String := "unchecked union restriction" & NUL;
|
||||
Rmsg_27 : constant String := "illegal use of remote access-to-" &
|
||||
"class-wide type, see RM E.4(18)" & NUL;
|
||||
Rmsg_28 : constant String := "empty storage pool" & NUL;
|
||||
Rmsg_29 : constant String := "explicit raise" & NUL;
|
||||
Rmsg_30 : constant String := "infinite recursion" & NUL;
|
||||
Rmsg_31 : constant String := "object too large" & NUL;
|
||||
Rmsg_32 : constant String := "restriction violation" & NUL;
|
||||
|
||||
-----------------------
|
||||
-- Polling Interface --
|
||||
|
@ -579,34 +537,6 @@ package body Ada.Exceptions is
|
|||
-- The actual polling routine is separate, so that it can easily
|
||||
-- be replaced with a target dependent version.
|
||||
|
||||
--------------------------
|
||||
-- Code_Address_For_AAA --
|
||||
--------------------------
|
||||
|
||||
-- This function gives us the start of the PC range for addresses
|
||||
-- within the exception unit itself. We hope that gigi/gcc keep all the
|
||||
-- procedures in their original order!
|
||||
|
||||
function Code_Address_For_AAA return System.Address is
|
||||
begin
|
||||
-- We are using a label instead of merely using
|
||||
-- Code_Address_For_AAA'Address because on some platforms the latter
|
||||
-- does not yield the address we want, but the address of a stub or of
|
||||
-- a descriptor instead. This is the case at least on Alpha-VMS and
|
||||
-- PA-HPUX.
|
||||
|
||||
<<Start_Of_AAA>>
|
||||
return Start_Of_AAA'Address;
|
||||
end Code_Address_For_AAA;
|
||||
|
||||
----------------
|
||||
-- Call_Chain --
|
||||
----------------
|
||||
|
||||
procedure Call_Chain (Excep : EOA) is separate;
|
||||
-- The actual Call_Chain routine is separate, so that it can easily
|
||||
-- be dummied out when no exception traceback information is needed.
|
||||
|
||||
------------------------------
|
||||
-- Current_Target_Exception --
|
||||
------------------------------
|
||||
|
@ -728,14 +658,21 @@ package body Ada.Exceptions is
|
|||
-- This package can be easily dummied out if we do not want the
|
||||
-- basic support for exception messages (such as in Ada 83).
|
||||
|
||||
---------------------------
|
||||
-- Exception_Propagation --
|
||||
---------------------------
|
||||
package body Exception_Propagation is
|
||||
|
||||
package body Exception_Propagation is separate;
|
||||
-- Depending on the actual exception mechanism used (front-end or
|
||||
-- back-end based), the implementation will differ, which is why this
|
||||
-- package is separated.
|
||||
procedure Setup_Exception
|
||||
(Excep : EOA;
|
||||
Current : EOA;
|
||||
Reraised : Boolean := False)
|
||||
is
|
||||
pragma Warnings (Off, Excep);
|
||||
pragma Warnings (Off, Current);
|
||||
pragma Warnings (Off, Reraised);
|
||||
begin
|
||||
null;
|
||||
end Setup_Exception;
|
||||
|
||||
end Exception_Propagation;
|
||||
|
||||
----------------------
|
||||
-- Exception_Traces --
|
||||
|
@ -759,12 +696,17 @@ package body Ada.Exceptions is
|
|||
-- Process_Raise_Exception --
|
||||
-----------------------------
|
||||
|
||||
procedure Process_Raise_Exception
|
||||
(E : Exception_Id;
|
||||
From_Signal_Handler : Boolean)
|
||||
is
|
||||
procedure Process_Raise_Exception (E : Exception_Id) 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;
|
||||
|
||||
procedure builtin_longjmp (buffer : Address; Flag : Integer);
|
||||
pragma No_Return (builtin_longjmp);
|
||||
pragma Import (C, builtin_longjmp, "_gnat_builtin_longjmp");
|
||||
|
||||
begin
|
||||
-- WARNING: There should be no exception handler for this body
|
||||
-- because this would cause gigi to prepend a setup for a new
|
||||
|
@ -773,7 +715,23 @@ package body Ada.Exceptions is
|
|||
-- one for the exception we are handling, which would completely break
|
||||
-- the whole design of this procedure.
|
||||
|
||||
Exception_Propagation.Propagate_Exception (From_Signal_Handler);
|
||||
-- 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
|
||||
Exception_Traces.Notify_Unhandled_Exception;
|
||||
Exception_Traces.Unhandled_Exception_Terminate;
|
||||
end if;
|
||||
end Process_Raise_Exception;
|
||||
|
||||
----------------------------
|
||||
|
@ -826,7 +784,7 @@ package body Ada.Exceptions is
|
|||
-- pragma Volatile is peculiar!
|
||||
|
||||
begin
|
||||
Process_Raise_Exception (E => E, From_Signal_Handler => False);
|
||||
Process_Raise_Exception (E);
|
||||
end Raise_Current_Excep;
|
||||
|
||||
---------------------
|
||||
|
@ -843,6 +801,14 @@ package body Ada.Exceptions is
|
|||
Abort_Defer.all;
|
||||
Raise_Current_Excep (E);
|
||||
end if;
|
||||
|
||||
-- Note: if E is null, then we simply return, which is correct Ada 95
|
||||
-- semantics. If we are operating in Ada 2005 mode, then the expander
|
||||
-- generates a raise Constraint_Error immediately following the call
|
||||
-- to provide the required Ada 2005 semantics (see AI-329). We do it
|
||||
-- this way to avoid having run time dependencies on the Ada version.
|
||||
|
||||
return;
|
||||
end Raise_Exception;
|
||||
|
||||
----------------------------
|
||||
|
@ -870,7 +836,7 @@ package body Ada.Exceptions is
|
|||
begin
|
||||
Exception_Data.Set_Exception_C_Msg (E, M);
|
||||
Abort_Defer.all;
|
||||
Process_Raise_Exception (E => E, From_Signal_Handler => True);
|
||||
Process_Raise_Exception (E);
|
||||
end Raise_From_Signal_Handler;
|
||||
|
||||
-------------------------
|
||||
|
@ -951,8 +917,6 @@ package body Ada.Exceptions is
|
|||
Excep : constant EOA := Get_Current_Excep.all;
|
||||
|
||||
begin
|
||||
Exception_Propagation.Setup_Exception (Excep, Excep);
|
||||
|
||||
Excep.Exception_Raised := False;
|
||||
Excep.Id := E;
|
||||
Excep.Num_Tracebacks := 0;
|
||||
|
@ -1033,7 +997,7 @@ package body Ada.Exceptions is
|
|||
|
||||
procedure Rcheck_13 (File : System.Address; Line : Integer) is
|
||||
begin
|
||||
Raise_Program_Error_Msg (File, Line, Rmsg_13'Address);
|
||||
Raise_Constraint_Error_Msg (File, Line, Rmsg_13'Address);
|
||||
end Rcheck_13;
|
||||
|
||||
procedure Rcheck_14 (File : System.Address; Line : Integer) is
|
||||
|
@ -1098,12 +1062,12 @@ package body Ada.Exceptions is
|
|||
|
||||
procedure Rcheck_26 (File : System.Address; Line : Integer) is
|
||||
begin
|
||||
Raise_Storage_Error_Msg (File, Line, Rmsg_26'Address);
|
||||
Raise_Program_Error_Msg (File, Line, Rmsg_26'Address);
|
||||
end Rcheck_26;
|
||||
|
||||
procedure Rcheck_27 (File : System.Address; Line : Integer) is
|
||||
begin
|
||||
Raise_Storage_Error_Msg (File, Line, Rmsg_27'Address);
|
||||
Raise_Program_Error_Msg (File, Line, Rmsg_27'Address);
|
||||
end Rcheck_27;
|
||||
|
||||
procedure Rcheck_28 (File : System.Address; Line : Integer) is
|
||||
|
@ -1121,6 +1085,16 @@ package body Ada.Exceptions is
|
|||
Raise_Storage_Error_Msg (File, Line, Rmsg_30'Address);
|
||||
end Rcheck_30;
|
||||
|
||||
procedure Rcheck_31 (File : System.Address; Line : Integer) is
|
||||
begin
|
||||
Raise_Storage_Error_Msg (File, Line, Rmsg_31'Address);
|
||||
end Rcheck_31;
|
||||
|
||||
procedure Rcheck_32 (File : System.Address; Line : Integer) is
|
||||
begin
|
||||
Raise_Storage_Error_Msg (File, Line, Rmsg_32'Address);
|
||||
end Rcheck_32;
|
||||
|
||||
-------------
|
||||
-- Reraise --
|
||||
-------------
|
||||
|
@ -1130,7 +1104,6 @@ package body Ada.Exceptions is
|
|||
|
||||
begin
|
||||
Abort_Defer.all;
|
||||
Exception_Propagation.Setup_Exception (Excep, Excep, Reraised => True);
|
||||
Raise_Current_Excep (Excep.Id);
|
||||
end Reraise;
|
||||
|
||||
|
@ -1142,8 +1115,6 @@ package body Ada.Exceptions is
|
|||
begin
|
||||
if X.Id /= null then
|
||||
Abort_Defer.all;
|
||||
Exception_Propagation.Setup_Exception
|
||||
(X'Unrestricted_Access, Get_Current_Excep.all, Reraised => True);
|
||||
Save_Occurrence_No_Private (Get_Current_Excep.all.all, X);
|
||||
Raise_Current_Excep (X.Id);
|
||||
end if;
|
||||
|
@ -1156,8 +1127,6 @@ package body Ada.Exceptions is
|
|||
procedure Reraise_Occurrence_Always (X : Exception_Occurrence) is
|
||||
begin
|
||||
Abort_Defer.all;
|
||||
Exception_Propagation.Setup_Exception
|
||||
(X'Unrestricted_Access, Get_Current_Excep.all, Reraised => True);
|
||||
Save_Occurrence_No_Private (Get_Current_Excep.all.all, X);
|
||||
Raise_Current_Excep (X.Id);
|
||||
end Reraise_Occurrence_Always;
|
||||
|
@ -1168,8 +1137,6 @@ package body Ada.Exceptions is
|
|||
|
||||
procedure Reraise_Occurrence_No_Defer (X : Exception_Occurrence) is
|
||||
begin
|
||||
Exception_Propagation.Setup_Exception
|
||||
(X'Unrestricted_Access, Get_Current_Excep.all, Reraised => True);
|
||||
Save_Occurrence_No_Private (Get_Current_Excep.all.all, X);
|
||||
Raise_Current_Excep (X.Id);
|
||||
end Reraise_Occurrence_No_Defer;
|
||||
|
@ -1230,7 +1197,6 @@ package body Ada.Exceptions is
|
|||
-- fixed TSD occurrence, which is very different from Get_Current_Excep
|
||||
-- here because this subprogram is called from the called task.
|
||||
|
||||
Exception_Propagation.Setup_Exception (Target, Target);
|
||||
Save_Occurrence_No_Private (Target.all, Source);
|
||||
end Transfer_Occurrence;
|
||||
|
||||
|
@ -1288,18 +1254,4 @@ package body Ada.Exceptions is
|
|||
end loop;
|
||||
end To_Stderr;
|
||||
|
||||
--------------------------
|
||||
-- Code_Address_For_ZZZ --
|
||||
--------------------------
|
||||
|
||||
-- This function gives us the end of the PC range for addresses
|
||||
-- within the exception unit itself. We hope that gigi/gcc keeps all the
|
||||
-- procedures in their original order!
|
||||
|
||||
function Code_Address_For_ZZZ return System.Address is
|
||||
begin
|
||||
<<Start_Of_ZZZ>>
|
||||
return Start_Of_ZZZ'Address;
|
||||
end Code_Address_For_ZZZ;
|
||||
|
||||
end Ada.Exceptions;
|
||||
|
|
|
@ -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);
|
||||
-- We must turn polling off for this unit, because otherwise we get
|
||||
-- elaboration circularities with ourself.
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
-- --
|
||||
-- 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 --
|
||||
-- terms of the GNU General Public License as published by the Free Soft- --
|
||||
|
@ -532,7 +532,11 @@ package body Exception_Propagation is
|
|||
-- Unwind_RaiseException to actually throw, taking care of handling
|
||||
-- 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);
|
||||
|
||||
Excep : constant EOA := Get_Current_Excep.all;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
-- --
|
||||
-- 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 --
|
||||
-- terms of the GNU General Public License as published by the Free Soft- --
|
||||
|
@ -69,7 +69,12 @@ package body Exception_Propagation is
|
|||
-- 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;
|
||||
Excep : constant EOA := Get_Current_Excep.all;
|
||||
begin
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
-- --
|
||||
-- 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 --
|
||||
-- terms of the GNU General Public License as published by the Free Soft- --
|
||||
|
@ -26,7 +26,7 @@
|
|||
|
||||
with ALI; use ALI;
|
||||
with Csets;
|
||||
with Gnatvsn;
|
||||
with Gnatvsn; use Gnatvsn;
|
||||
with Makeutl;
|
||||
with MLib.Tgt; use MLib.Tgt;
|
||||
with Namet; use Namet;
|
||||
|
@ -1288,8 +1288,11 @@ package body Clean is
|
|||
begin
|
||||
if not Copyright_Displayed then
|
||||
Copyright_Displayed := True;
|
||||
Put_Line ("GNATCLEAN " & Gnatvsn.Gnat_Version_String
|
||||
& " Copyright 2003-2005 Free Software Foundation, Inc.");
|
||||
Put_Line
|
||||
("GNATCLEAN " & Gnatvsn.Gnat_Version_String
|
||||
& " Copyright 2003-"
|
||||
& Current_Year
|
||||
& " Free Software Foundation, Inc.");
|
||||
end if;
|
||||
end Display_Copyright;
|
||||
|
||||
|
@ -1308,7 +1311,6 @@ package body Clean is
|
|||
|
||||
procedure Extract_From_Q (Lib_File : out File_Name_Type) is
|
||||
Lib : constant File_Name_Type := Q.Table (Q_Front);
|
||||
|
||||
begin
|
||||
Q_Front := Q_Front + 1;
|
||||
Lib_File := Lib;
|
||||
|
@ -1501,12 +1503,27 @@ package body Clean is
|
|||
if not Initialized then
|
||||
Initialized := True;
|
||||
|
||||
-- Get default search directories to locate system.ads when calling
|
||||
-- Targparm.Get_Target_Parameters.
|
||||
|
||||
Osint.Add_Default_Search_Dirs;
|
||||
|
||||
-- Initialize some packages
|
||||
|
||||
Csets.Initialize;
|
||||
Namet.Initialize;
|
||||
Snames.Initialize;
|
||||
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;
|
||||
|
||||
-- Reset global variables
|
||||
|
@ -1897,11 +1914,4 @@ package body Clean is
|
|||
New_Line;
|
||||
end if;
|
||||
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;
|
||||
|
|
51
gcc/ada/s-wchcon.adb
Executable file
51
gcc/ada/s-wchcon.adb
Executable file
|
@ -0,0 +1,51 @@
|
|||
------------------------------------------------------------------------------
|
||||
-- --
|
||||
-- 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
|
|||
-- 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.
|
||||
|
||||
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;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
-- --
|
||||
-- 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 --
|
||||
-- terms of the GNU General Public License as published by the Free Soft- --
|
||||
|
@ -725,7 +725,7 @@ package Types is
|
|||
-----------------------------------
|
||||
|
||||
-- This section contains declarations of exceptions that are used
|
||||
-- throughout the compiler.
|
||||
-- throughout the compiler or in other GNAT tools.
|
||||
|
||||
Unrecoverable_Error : exception;
|
||||
-- This exception is raised to immediately terminate the compilation
|
||||
|
@ -734,6 +734,14 @@ package Types is
|
|||
-- reached, or a required file is not found). Also raised when the
|
||||
-- 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 --
|
||||
---------------------------------
|
||||
|
@ -774,42 +782,45 @@ package Types is
|
|||
-- the definition of last_reason_code.
|
||||
|
||||
-- 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,
|
||||
CE_Access_Parameter_Is_Null,
|
||||
CE_Discriminant_Check_Failed,
|
||||
CE_Divide_By_Zero,
|
||||
CE_Explicit_Raise,
|
||||
CE_Index_Check_Failed,
|
||||
CE_Invalid_Data,
|
||||
CE_Length_Check_Failed,
|
||||
CE_Null_Not_Allowed,
|
||||
CE_Overflow_Check_Failed,
|
||||
CE_Partition_Check_Failed,
|
||||
CE_Range_Check_Failed,
|
||||
CE_Tag_Check_Failed,
|
||||
type RT_Exception_Code is
|
||||
(CE_Access_Check_Failed, -- 00
|
||||
CE_Access_Parameter_Is_Null, -- 01
|
||||
CE_Discriminant_Check_Failed, -- 02
|
||||
CE_Divide_By_Zero, -- 03
|
||||
CE_Explicit_Raise, -- 04
|
||||
CE_Index_Check_Failed, -- 05
|
||||
CE_Invalid_Data, -- 06
|
||||
CE_Length_Check_Failed, -- 07
|
||||
CE_Null_Exception_Id, -- 08
|
||||
CE_Null_Not_Allowed, -- 09
|
||||
CE_Overflow_Check_Failed, -- 10
|
||||
CE_Partition_Check_Failed, -- 11
|
||||
CE_Range_Check_Failed, -- 12
|
||||
CE_Tag_Check_Failed, -- 13
|
||||
|
||||
PE_Access_Before_Elaboration,
|
||||
PE_Accessibility_Check_Failed,
|
||||
PE_All_Guards_Closed,
|
||||
PE_Duplicated_Entry_Address,
|
||||
PE_Explicit_Raise,
|
||||
PE_Finalize_Raised_Exception,
|
||||
PE_Misaligned_Address_Value,
|
||||
PE_Missing_Return,
|
||||
PE_Overlaid_Controlled_Object,
|
||||
PE_Potentially_Blocking_Operation,
|
||||
PE_Stubbed_Subprogram_Called,
|
||||
PE_Unchecked_Union_Restriction,
|
||||
PE_Illegal_RACW_E_4_18,
|
||||
PE_Access_Before_Elaboration, -- 14
|
||||
PE_Accessibility_Check_Failed, -- 15
|
||||
PE_All_Guards_Closed, -- 16
|
||||
PE_Duplicated_Entry_Address, -- 17
|
||||
PE_Explicit_Raise, -- 18
|
||||
PE_Finalize_Raised_Exception, -- 19
|
||||
PE_Implicit_Return, -- 20
|
||||
PE_Misaligned_Address_Value, -- 21
|
||||
PE_Missing_Return, -- 22
|
||||
PE_Overlaid_Controlled_Object, -- 23
|
||||
PE_Potentially_Blocking_Operation, -- 24
|
||||
PE_Stubbed_Subprogram_Called, -- 25
|
||||
PE_Unchecked_Union_Restriction, -- 26
|
||||
PE_Illegal_RACW_E_4_18, -- 27
|
||||
|
||||
SE_Empty_Storage_Pool,
|
||||
SE_Explicit_Raise,
|
||||
SE_Infinite_Recursion,
|
||||
SE_Object_Too_Large,
|
||||
SE_Restriction_Violation);
|
||||
SE_Empty_Storage_Pool, -- 28
|
||||
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
|
||||
CE_Access_Check_Failed ..
|
||||
|
|
|
@ -338,28 +338,32 @@ typedef Int Mechanism_Type;
|
|||
#define CE_Index_Check_Failed 5
|
||||
#define CE_Invalid_Data 6
|
||||
#define CE_Length_Check_Failed 7
|
||||
#define CE_Null_Not_Allowed 8
|
||||
#define CE_Overflow_Check_Failed 9
|
||||
#define CE_Partition_Check_Failed 10
|
||||
#define CE_Range_Check_Failed 11
|
||||
#define CE_Tag_Check_Failed 12
|
||||
#define PE_Access_Before_Elaboration 13
|
||||
#define PE_Accessibility_Check_Failed 14
|
||||
#define PE_All_Guards_Closed 15
|
||||
#define PE_Duplicated_Entry_Address 16
|
||||
#define PE_Explicit_Raise 17
|
||||
#define PE_Finalize_Raised_Exception 18
|
||||
#define PE_Misaligned_Address_Value 19
|
||||
#define PE_Missing_Return 20
|
||||
#define PE_Overlaid_Controlled_Object 21
|
||||
#define PE_Potentially_Blocking_Operation 22
|
||||
#define PE_Stubbed_Subprogram_Called 23
|
||||
#define PE_Unchecked_Union_Restriction 24
|
||||
#define PE_Illegal_RACW_E_4_18 25
|
||||
#define SE_Empty_Storage_Pool 26
|
||||
#define SE_Explicit_Raise 27
|
||||
#define SE_Infinite_Recursion 28
|
||||
#define SE_Object_Too_Large 29
|
||||
#define SE_Restriction_Violation 30
|
||||
#define CE_Null_Exception_Id 9
|
||||
#define CE_Null_Not_Allowed 9
|
||||
#define CE_Overflow_Check_Failed 10
|
||||
#define CE_Partition_Check_Failed 11
|
||||
#define CE_Range_Check_Failed 12
|
||||
#define CE_Tag_Check_Failed 13
|
||||
|
||||
#define LAST_REASON_CODE 30
|
||||
#define PE_Access_Before_Elaboration 14
|
||||
#define PE_Accessibility_Check_Failed 15
|
||||
#define PE_All_Guards_Closed 16
|
||||
#define PE_Duplicated_Entry_Address 17
|
||||
#define PE_Explicit_Raise 18
|
||||
#define PE_Finalize_Raised_Exception 19
|
||||
#define PE_Implicit_Return 20
|
||||
#define PE_Misaligned_Address_Value 21
|
||||
#define PE_Missing_Return 22
|
||||
#define PE_Overlaid_Controlled_Object 23
|
||||
#define PE_Potentially_Blocking_Operation 24
|
||||
#define PE_Stubbed_Subprogram_Called 25
|
||||
#define PE_Unchecked_Union_Restriction 26
|
||||
#define PE_Illegal_RACW_E_4_18 27
|
||||
|
||||
#define SE_Empty_Storage_Pool 28
|
||||
#define SE_Explicit_Raise 29
|
||||
#define SE_Infinite_Recursion 30
|
||||
#define SE_Object_Too_Large 31
|
||||
#define SE_Restriction_Violation 32
|
||||
|
||||
#define LAST_REASON_CODE 31
|
||||
|
|
Loading…
Add table
Reference in a new issue