diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-10-27 19:41:13 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-10-27 19:41:13 +0000 |
commit | b45192abaabbb4ae50cdf51c07843d631bdf043f (patch) | |
tree | 1533ea9b890ad29fc0b40626d470d5c567ecf626 | |
parent | a96447936c1e066a24a0d58a7e9a39c223a04dd9 (diff) | |
download | gcc-b45192abaabbb4ae50cdf51c07843d631bdf043f.tar.gz |
* raise-gcc (db_region_for): Use _Unwind_GetIPInfo instead of
_Unwind_GetIP if HAVE_GETIPINFO is defined.
(db_action_for): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153613 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ada/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ada/raise-gcc.c | 34 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/null_pointer_deref1.adb | 2 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/null_pointer_deref2.adb | 2 |
5 files changed, 37 insertions, 12 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 9ba4bcf4bd7..9c6be32f860 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2009-10-27 Eric Botcazou <ebotcazou@adacore.com> + + * raise-gcc (db_region_for): Use _Unwind_GetIPInfo instead of + _Unwind_GetIP if HAVE_GETIPINFO is defined. + (db_action_for): Likewise. + 2009-10-27 Robert Dewar <dewar@adacore.com> * s-fileio.adb, s-fileio.ads, sem_util.adb, sem_warn.adb, diff --git a/gcc/ada/raise-gcc.c b/gcc/ada/raise-gcc.c index 1d9efb93b7f..3589bc5dfd1 100644 --- a/gcc/ada/raise-gcc.c +++ b/gcc/ada/raise-gcc.c @@ -56,6 +56,14 @@ typedef char bool; #include "adaint.h" #include "raise.h" +#ifdef __APPLE__ +/* On MacOS X, versions older than 10.5 don't export _Unwind_GetIPInfo. */ +#undef HAVE_GETIPINFO +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050 +#define HAVE_GETIPINFO 1 +#endif +#endif + /* The names of a couple of "standard" routines for unwinding/propagation actually vary depending on the underlying GCC scheme for exception handling (SJLJ or DWARF). We need a consistently named interface to import from @@ -501,7 +509,14 @@ typedef struct static void db_region_for (region_descriptor *region, _Unwind_Context *uw_context) { - _Unwind_Ptr ip = _Unwind_GetIP (uw_context) - 1; + int ip_before_insn = 0; +#ifdef HAVE_GETIPINFO + _Unwind_Ptr ip = _Unwind_GetIPInfo (uw_context, &ip_before_insn); +#else + _Unwind_Ptr ip = _Unwind_GetIP (uw_context); +#endif + if (!ip_before_insn) + ip--; if (! (db_accepted_codes () & DB_REGIONS)) return; @@ -631,7 +646,14 @@ typedef struct static void db_action_for (action_descriptor *action, _Unwind_Context *uw_context) { - _Unwind_Ptr ip = _Unwind_GetIP (uw_context) - 1; + int ip_before_insn = 0; +#ifdef HAVE_GETIPINFO + _Unwind_Ptr ip = _Unwind_GetIPInfo (uw_context, &ip_before_insn); +#else + _Unwind_Ptr ip = _Unwind_GetIP (uw_context); +#endif + if (!ip_before_insn) + ip--; db (DB_ACTIONS, "For ip @ 0x%08x => ", ip); @@ -670,14 +692,6 @@ db_action_for (action_descriptor *action, _Unwind_Context *uw_context) There are two variants of this routine, depending on the underlying mechanism (DWARF/SJLJ), which account for differences in the tables. */ -#ifdef __APPLE__ -/* On MacOS X, versions older than 10.5 don't export _Unwind_GetIPInfo. */ -#undef HAVE_GETIPINFO -#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050 -#define HAVE_GETIPINFO 1 -#endif -#endif - #ifdef __USING_SJLJ_EXCEPTIONS__ #define __builtin_eh_return_data_regno(x) x diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 819cb5d894d..7c29cdfe1b2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-10-27 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/null_pointer_deref1.adb: Accept Constraint_Error. + * gnat.dg/null_pointer_deref2.adb: Likewise. + 2009-10-27 Richard Guenther <rguenther@suse.de> * gcc.dg/torture/ipa-pta-1.c: Adjust testcase. diff --git a/gcc/testsuite/gnat.dg/null_pointer_deref1.adb b/gcc/testsuite/gnat.dg/null_pointer_deref1.adb index 817155dc1c9..6e7bf14e5df 100644 --- a/gcc/testsuite/gnat.dg/null_pointer_deref1.adb +++ b/gcc/testsuite/gnat.dg/null_pointer_deref1.adb @@ -17,5 +17,5 @@ procedure Null_Pointer_Deref1 is begin Data.all := 1; exception - when Storage_Error => null; + when Constraint_Error | Storage_Error => null; end; diff --git a/gcc/testsuite/gnat.dg/null_pointer_deref2.adb b/gcc/testsuite/gnat.dg/null_pointer_deref2.adb index b1dd548f01b..63e2dd11f39 100644 --- a/gcc/testsuite/gnat.dg/null_pointer_deref2.adb +++ b/gcc/testsuite/gnat.dg/null_pointer_deref2.adb @@ -20,7 +20,7 @@ procedure Null_Pointer_Deref2 is begin Data.all := 1; exception - when Storage_Error => null; + when Constraint_Error | Storage_Error => null; end T; begin |