X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Funwind-sjlj.c;h=0dd4a8395a39c80821028590dccb5e30bc69aa8e;hb=1e5fcbe2009a34584768d8b8833756bc8de97dc3;hp=6d6fd8bc9b54878130b258461333c16a4573bc32;hpb=c7beb4b3442a3c637a2584e1bddaa64bb8152be1;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/unwind-sjlj.c b/gcc/unwind-sjlj.c index 6d6fd8bc9b5..0dd4a8395a3 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, 2004 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 @@ -173,10 +182,10 @@ _Unwind_GetGR (struct _Unwind_Context *context, int index) /* Get the value of the CFA as saved in CONTEXT. */ _Unwind_Word -_Unwind_GetCFA (struct _Unwind_Context *context) +_Unwind_GetCFA (struct _Unwind_Context *context __attribute__((unused))) { /* ??? Ideally __builtin_setjmp places the CFA in the jmpbuf. */ - return NULL; + return (_Unwind_Word) 0; } void @@ -214,7 +223,7 @@ _Unwind_GetRegionStart (struct _Unwind_Context *context __attribute__((unused)) } void * -_Unwind_FindEnclosingFunction (void *pc) +_Unwind_FindEnclosingFunction (void *pc __attribute__((unused))) { return NULL; } @@ -261,16 +270,13 @@ 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. */ -#define uw_install_context(CURRENT, TARGET) \ - do \ - { \ - _Unwind_SjLj_SetContext ((TARGET)->fc); \ - longjmp ((TARGET)->fc->jbuf, 1); \ - } \ - while (0) - +static void __attribute__((noreturn)) +uw_install_context (struct _Unwind_Context *current __attribute__((unused)), + struct _Unwind_Context *target) +{ + _Unwind_SjLj_SetContext (target->fc); + longjmp (target->fc->jbuf, 1); +} static inline _Unwind_Ptr uw_identify_context (struct _Unwind_Context *context) @@ -285,6 +291,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"