X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Funwind-sjlj.c;h=376135574e0ac69b43497f0dc243195dd4643a6a;hb=658fc6b4e6c918222cc8ec22e1f396e0cda0fe28;hp=2161b71b7fc658aa1e9445200faa8178756dc2e2;hpb=ac0c7fb1dcdaddb68f447b490882265dfd7f688c;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/unwind-sjlj.c b/gcc/unwind-sjlj.c index 2161b71b7fc..376135574e0 100644 --- a/gcc/unwind-sjlj.c +++ b/gcc/unwind-sjlj.c @@ -1,5 +1,5 @@ -/* DWARF2 exception handling and frame unwind runtime interface routines. - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 +/* SJLJ exception handling and frame unwind runtime interface routines. + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GCC. @@ -9,6 +9,15 @@ the Free Software Foundation; either version 2, or (at your option) any later version. + In addition to the permissions in the GNU General Public License, the + Free Software Foundation gives you unlimited permission to link the + compiled version of this file into combinations with other programs, + and to distribute those combinations without any restriction coming + from the use of this file. (The General Public License restrictions + do apply in other respects; for example, they cover modification of + the file, and distribution when not linked into a combined + executable.) + GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public @@ -21,6 +30,8 @@ #include "tconfig.h" #include "tsystem.h" +#include "coretypes.h" +#include "tm.h" #include "unwind.h" #include "gthr.h" @@ -63,7 +74,7 @@ struct SjLj_Function_Context #ifdef DONT_USE_BUILTIN_SETJMP /* We don't know what sort of alignment requirements the system jmp_buf has. We over estimated in except.c, and now we have - to match that here just in case the system *didn't* have more + to match that here just in case the system *didn't* have more restrictive requirements. */ jmp_buf jbuf __attribute__((aligned)); #else @@ -76,7 +87,7 @@ struct _Unwind_Context struct SjLj_Function_Context *fc; }; -typedef struct +typedef struct { _Unwind_Personality_Fn personality; } _Unwind_FrameState; @@ -92,15 +103,9 @@ static __gthread_key_t fc_key; static int use_fc_key = -1; static void -fc_key_dtor (void *ptr) -{ - __gthread_key_dtor (fc_key, ptr); -} - -static void fc_key_init (void) { - use_fc_key = __gthread_key_create (&fc_key, fc_key_dtor) == 0; + use_fc_key = __gthread_key_create (&fc_key, 0) == 0; } static void @@ -174,6 +179,15 @@ _Unwind_GetGR (struct _Unwind_Context *context, int index) return context->fc->data[index]; } +/* Get the value of the CFA as saved in CONTEXT. */ + +_Unwind_Word +_Unwind_GetCFA (struct _Unwind_Context *context) +{ + /* ??? Ideally __builtin_setjmp places the CFA in the jmpbuf. */ + return NULL; +} + void _Unwind_SetGR (struct _Unwind_Context *context, int index, _Unwind_Word val) { @@ -208,6 +222,12 @@ _Unwind_GetRegionStart (struct _Unwind_Context *context __attribute__((unused)) return 0; } +void * +_Unwind_FindEnclosingFunction (void *pc) +{ + return NULL; +} + #ifndef __ia64__ _Unwind_Ptr _Unwind_GetDataRelBase (struct _Unwind_Context *context __attribute__((unused)) ) @@ -244,14 +264,14 @@ uw_update_context (struct _Unwind_Context *context, context->fc = context->fc->prev; } -static inline void +static inline void uw_init_context (struct _Unwind_Context *context) { context->fc = _Unwind_SjLj_GetContext (); } /* ??? There appear to be bugs in integrate.c wrt __builtin_longjmp and - virtual-stack-vars. An inline version of this segfaults on Sparc. */ + virtual-stack-vars. An inline version of this segfaults on SPARC. */ #define uw_install_context(CURRENT, TARGET) \ do \ { \ @@ -274,6 +294,7 @@ uw_identify_context (struct _Unwind_Context *context) #define _Unwind_RaiseException _Unwind_SjLj_RaiseException #define _Unwind_ForcedUnwind _Unwind_SjLj_ForcedUnwind #define _Unwind_Resume _Unwind_SjLj_Resume +#define _Unwind_Resume_or_Rethrow _Unwind_SjLj_Resume_or_Rethrow #include "unwind.inc"