X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Funwind.inc;h=f905b47f1476654868f342bec735de867268bab3;hb=ecc3a7ab76907cdb1a31fdb6502f4022b0cefe79;hp=0938d501f5fb53b0306f3601e4dcb9691b4778e2;hpb=ce9beb5c23c114e2a17eba595c8f4b5287022db9;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/unwind.inc b/gcc/unwind.inc index 0938d501f5f..f905b47f147 100644 --- a/gcc/unwind.inc +++ b/gcc/unwind.inc @@ -1,5 +1,5 @@ /* Exception handling and frame unwind runtime interface routines. -*- C -*- - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001, 2003 Free Software Foundation, Inc. This file is part of GCC. @@ -8,6 +8,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 @@ -15,8 +24,8 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. */ /* This is derived from the C++ ABI for IA-64. Where we diverge for cross-architecture compatibility are noted with "@@@". @@ -63,8 +72,7 @@ _Unwind_RaiseException_Phase2(struct _Unwind_Exception *exc, } /* Don't let us unwind past the handler context. */ - if (match_handler) - abort (); + gcc_assert (!match_handler); uw_update_context (context, &fs); } @@ -74,7 +82,7 @@ _Unwind_RaiseException_Phase2(struct _Unwind_Exception *exc, /* Raise an exception, passing along the given exception object. */ -_Unwind_Reason_Code +_Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE _Unwind_RaiseException(struct _Unwind_Exception *exc) { struct _Unwind_Context this_context, cur_context; @@ -135,8 +143,8 @@ _Unwind_RaiseException(struct _Unwind_Exception *exc) /* Subroutine of _Unwind_ForcedUnwind also invoked from _Unwind_Resume. */ static _Unwind_Reason_Code -_Unwind_ForcedUnwind_Phase2(struct _Unwind_Exception *exc, - struct _Unwind_Context *context) +_Unwind_ForcedUnwind_Phase2 (struct _Unwind_Exception *exc, + struct _Unwind_Context *context) { _Unwind_Stop_Fn stop = (_Unwind_Stop_Fn) (_Unwind_Ptr) exc->private_1; void *stop_argument = (void *) (_Unwind_Ptr) exc->private_2; @@ -176,8 +184,9 @@ _Unwind_ForcedUnwind_Phase2(struct _Unwind_Exception *exc, return _URC_FATAL_PHASE2_ERROR; } - /* Update cur_context to describe the same frame as fs. */ - uw_update_context (context, &fs); + /* Update cur_context to describe the same frame as fs, and discard + the previous context if necessary. */ + uw_advance_context (context, &fs); } return code; @@ -186,7 +195,7 @@ _Unwind_ForcedUnwind_Phase2(struct _Unwind_Exception *exc, /* Raise an exception for forced unwinding. */ -_Unwind_Reason_Code +_Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE _Unwind_ForcedUnwind (struct _Unwind_Exception *exc, _Unwind_Stop_Fn stop, void * stop_argument) { @@ -210,7 +219,7 @@ _Unwind_ForcedUnwind (struct _Unwind_Exception *exc, /* Resume propagation of an existing exception. This is used after e.g. executing cleanup code, and not to implement rethrowing. */ -void +void LIBGCC2_UNWIND_ATTRIBUTE _Unwind_Resume (struct _Unwind_Exception *exc) { struct _Unwind_Context this_context, cur_context; @@ -226,8 +235,7 @@ _Unwind_Resume (struct _Unwind_Exception *exc) else code = _Unwind_ForcedUnwind_Phase2 (exc, &cur_context); - if (code != _URC_INSTALL_CONTEXT) - abort (); + gcc_assert (code == _URC_INSTALL_CONTEXT); uw_install_context (&this_context, &cur_context); } @@ -236,7 +244,7 @@ _Unwind_Resume (struct _Unwind_Exception *exc) /* Resume propagation of an FORCE_UNWIND exception, or to rethrow a normal exception that was handled. */ -_Unwind_Reason_Code +_Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE _Unwind_Resume_or_Rethrow (struct _Unwind_Exception *exc) { struct _Unwind_Context this_context, cur_context; @@ -252,8 +260,7 @@ _Unwind_Resume_or_Rethrow (struct _Unwind_Exception *exc) code = _Unwind_ForcedUnwind_Phase2 (exc, &cur_context); - if (code != _URC_INSTALL_CONTEXT) - abort (); + gcc_assert (code == _URC_INSTALL_CONTEXT); uw_install_context (&this_context, &cur_context); } @@ -271,7 +278,7 @@ _Unwind_DeleteException (struct _Unwind_Exception *exc) /* Perform stack backtrace through unwind data. */ -_Unwind_Reason_Code +_Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE _Unwind_Backtrace(_Unwind_Trace_Fn trace, void * trace_argument) { struct _Unwind_Context context;