diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-10-14 13:06:44 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-10-14 13:06:44 +0000 |
commit | b0ce7476f2254675e0078a785e49d7edf7db56a9 (patch) | |
tree | 67a482fe81e10cfe634ac5d4ee42783847372e6e /gcc/ada/raise-gcc.c | |
parent | 8de3c1935f1a39ac8587c56c6b71b431f62831fb (diff) | |
download | gcc-b0ce7476f2254675e0078a785e49d7edf7db56a9.tar.gz |
2013-10-14 Tristan Gingold <gingold@adacore.com>
* cstand.adb (Create_Standard): Change Import_Code component
of Standard_Exception_Type to Foreign_Data. Its type is now
Standard_A_Char (access to character).
* exp_prag.adb (Expand_Pragma_Import_Export_Exception): Adjust
definition of Code to match the type of Foreign_Data.
* s-stalib.ads (Exception_Data): Replace Import_Code by Foreign_Data
Change the definition of standard predefined exceptions.
(Exception_Code): Remove.
* raise.h (Exception_Code): Remove (Exception_Data): Replace
Import_Code field by Foreign_Data.
* rtsfind.ads (RE_Exception_Code): Remove
(RE_Import_Address): Add.
* a-exexpr-gcc.adb (Import_Code_For): Replaced by Foreign_Data_For.
* exp_ch11.adb (Expand_N_Exception_Declaration): Associate null
to Foreign_Data component.
* raise-gcc.c (Import_Code_For): Replaced by Foreign_Data_For.
(is_handled_by): Add comments. Use replaced function. Change
condition so that an Ada occurrence is never handled by
Foreign_Exception.
* s-exctab.adb (Internal_Exception): Associate Null_Address to
Foreign_Data component.
* s-vmexta.adb, s-vmexta.ads (Exception_Code): Declare Replace
SSL.Exception_Code by Exception_Code.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@203538 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/raise-gcc.c')
-rw-r--r-- | gcc/ada/raise-gcc.c | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/gcc/ada/raise-gcc.c b/gcc/ada/raise-gcc.c index d80456436ec..897dca285c9 100644 --- a/gcc/ada/raise-gcc.c +++ b/gcc/ada/raise-gcc.c @@ -812,22 +812,32 @@ get_call_site_action_for (_Unwind_Ptr ip, #define Is_Handled_By_Others __gnat_is_handled_by_others #define Language_For __gnat_language_for -#define Import_Code_For __gnat_import_code_for +#define Foreign_Data_For __gnat_foreign_data_for #define EID_For __gnat_eid_for extern bool Is_Handled_By_Others (_Unwind_Ptr eid); extern char Language_For (_Unwind_Ptr eid); -extern Exception_Code Import_Code_For (_Unwind_Ptr eid); +extern void *Foreign_Data_For (_Unwind_Ptr eid); extern Exception_Id EID_For (_GNAT_Exception * e); +#define Foreign_Exception system__exceptions__foreign_exception +extern struct Exception_Data Foreign_Exception; + +#ifdef VMS +#define Non_Ada_Error system__aux_dec__non_ada_error +extern struct Exception_Data Non_Ada_Error; +#endif + static enum action_kind is_handled_by (_Unwind_Ptr choice, _GNAT_Exception * propagated_exception) { + /* All others choice match everything. */ if (choice == GNAT_ALL_OTHERS) return handler; + /* GNAT exception occurrence. */ if (propagated_exception->common.exception_class == GNAT_EXCEPTION_CLASS) { /* Pointer to the GNAT exception data corresponding to the propagated @@ -845,6 +855,7 @@ is_handled_by (_Unwind_Ptr choice, _GNAT_Exception * propagated_exception) if (choice == E || (choice == GNAT_OTHERS && Is_Handled_By_Others (E))) return handler; +#ifdef VMS /* In addition, on OpenVMS, Non_Ada_Error matches VMS exceptions, and we may have different exception data pointers that should match for the same condition code, if both an export and an import have been @@ -852,29 +863,25 @@ is_handled_by (_Unwind_Ptr choice, _GNAT_Exception * propagated_exception) occurrence are expected to have been masked off regarding severity bits already (at registration time for the former and from within the low level exception vector for the latter). */ -#ifdef VMS -# define Non_Ada_Error system__aux_dec__non_ada_error - extern struct Exception_Data Non_Ada_Error; - if ((Language_For (E) == 'V' && choice != GNAT_OTHERS && ((Language_For (choice) == 'V' - && Import_Code_For (choice) != 0 - && Import_Code_For (choice) == Import_Code_For (E)) + && Foreign_Data_For (choice) != 0 + && Foreign_Data_For (choice) == Foreign_Data_For (E)) || choice == (_Unwind_Ptr)&Non_Ada_Error))) return handler; #endif - } - else - { -# define Foreign_Exception system__exceptions__foreign_exception - extern struct Exception_Data Foreign_Exception; - if (choice == GNAT_ALL_OTHERS - || choice == GNAT_OTHERS - || choice == (_Unwind_Ptr) &Foreign_Exception) - return handler; + /* Otherwise, it doesn't match an Ada choice. */ + return nothing; } + + /* All others and others choice match any foreign exception. */ + if (choice == GNAT_ALL_OTHERS + || choice == GNAT_OTHERS + || choice == (_Unwind_Ptr) &Foreign_Exception) + return handler; + return nothing; } |