This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

_Unwind_ForcedUnwind tweak


I was looking at using ForcedUnwind elsewhere, and discovered that the
original IA-64 spec sez that end-of-stack is denoted by a null stack
pointer.  Except that across architectures we don't know what register
number is associated with the stack pointer.

So I've added this extension to let us easily recognize this condition.


r~


        * unwind.h (_UA_END_OF_STACK): New flag.
        * unwind.inc (_Unwind_ForcedUnwind_Phase2): Set it.

Index: unwind.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/unwind.h,v
retrieving revision 1.3
diff -c -p -d -r1.3 unwind.h
*** unwind.h	2001/08/22 14:35:50	1.3
--- unwind.h	2001/09/04 18:15:51
*************** typedef int _Unwind_Action;
*** 87,92 ****
--- 87,93 ----
  #define _UA_CLEANUP_PHASE	2
  #define _UA_HANDLER_FRAME	4
  #define _UA_FORCE_UNWIND	8
+ #define _UA_END_OF_STACK	16
  
  /* This is an opaque type used to refer to a system-specific data
     structure used by the system unwinder. This context is created and
Index: unwind.inc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/unwind.inc,v
retrieving revision 1.4
diff -c -p -d -r1.4 unwind.inc
*** unwind.inc	2001/08/22 14:35:50	1.4
--- unwind.inc	2001/09/04 18:15:51
*************** _Unwind_ForcedUnwind_Phase2(struct _Unwi
*** 142,155 ****
    while (1)
      {
        _Unwind_FrameState fs;
  
        code = uw_frame_state_for (context, &fs);
        if (code != _URC_NO_REASON && code != _URC_END_OF_STACK)
  	return _URC_FATAL_PHASE2_ERROR;
  
        /* Unwind successful.  */
!       stop_code = (*stop) (1, _UA_FORCE_UNWIND | _UA_CLEANUP_PHASE,
! 			   exc->exception_class, exc, context, stop_argument);
        if (stop_code != _URC_NO_REASON)
  	return _URC_FATAL_PHASE2_ERROR;
  
--- 142,159 ----
    while (1)
      {
        _Unwind_FrameState fs;
+       int action;
  
        code = uw_frame_state_for (context, &fs);
        if (code != _URC_NO_REASON && code != _URC_END_OF_STACK)
  	return _URC_FATAL_PHASE2_ERROR;
  
        /* Unwind successful.  */
!       action = _UA_FORCE_UNWIND | _UA_CLEANUP_PHASE;
!       if (code == _URC_END_OF_STACK)
! 	action |= _UA_END_OF_STACK;
!       stop_code = (*stop) (1, action, exc->exception_class, exc,
! 			   context, stop_argument);
        if (stop_code != _URC_NO_REASON)
  	return _URC_FATAL_PHASE2_ERROR;
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]