diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2009-10-27 19:41:13 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2009-10-27 19:41:13 +0000 |
commit | df66d1652823a218e63ed72cc590e707b312f804 (patch) | |
tree | 1533ea9b890ad29fc0b40626d470d5c567ecf626 /gcc/ada/raise-gcc.c | |
parent | 4c0f4b0b2f4d38b532d4602688083f965c50af82 (diff) | |
download | gcc-df66d1652823a218e63ed72cc590e707b312f804.zip gcc-df66d1652823a218e63ed72cc590e707b312f804.tar.gz gcc-df66d1652823a218e63ed72cc590e707b312f804.tar.bz2 |
raise-gcc (db_region_for): Use _Unwind_GetIPInfo instead of _Unwind_GetIP if HAVE_GETIPINFO is defined.
* raise-gcc (db_region_for): Use _Unwind_GetIPInfo instead of
_Unwind_GetIP if HAVE_GETIPINFO is defined.
(db_action_for): Likewise.
From-SVN: r153613
Diffstat (limited to 'gcc/ada/raise-gcc.c')
-rw-r--r-- | gcc/ada/raise-gcc.c | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/gcc/ada/raise-gcc.c b/gcc/ada/raise-gcc.c index 1d9efb93b..3589bc5 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 |