* config/ia64/linux.h (MD_FALLBACK_FRAME_STATE_FOR):
authorhboehm <hboehm@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 Mar 2002 21:27:12 +0000 (21:27 +0000)
committerhboehm <hboehm@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 Mar 2002 21:27:12 +0000 (21:27 +0000)
Restore more of the signal context.  Set no_reg_stack_frame.
* config/ia64/unwind-ia64.c (unw_state_record):
Add no_reg_stack_frame, comments.
(uw_frame_state_for): Initialize when field to UNW_WHEN_NEVER.
(uw_update_context): Adjust bsp when unwinding from leaf,
but not signal frame.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51407 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/ia64/linux.h
gcc/config/ia64/unwind-ia64.c

index 90b3bab..df46d03 100644 (file)
@@ -1,3 +1,12 @@
+2002-03-26  Hans Boehm <Hans_Boehm@hp.com>
+       * config/ia64/linux.h (MD_FALLBACK_FRAME_STATE_FOR):
+       Restore more of the signal context.  Set no_reg_stack_frame.
+       * config/ia64/unwind-ia64.c (unw_state_record):
+       Add no_reg_stack_frame, comments.
+       (uw_frame_state_for): Initialize when field to UNW_WHEN_NEVER.
+       (uw_update_context): Adjust bsp when unwinding from leaf,
+       but not signal frame.
+
 2002-03-26  David Edelsohn  <edelsohn@gnu.org>
 
        * config/rs6000/aix51.h (WCHAR_TYPE): Define.
index 1889ef6..ac77af2 100644 (file)
       (CONTEXT)->pfs_loc = &(sc_->sc_ar_pfs);                          \
       (CONTEXT)->lc_loc = &(sc_->sc_ar_lc);                            \
       (CONTEXT)->unat_loc = &(sc_->sc_ar_unat);                                \
+      (CONTEXT)->br_loc[0] = &(sc_->sc_br[0]);                         \
+      (CONTEXT)->bsp = sc_->sc_ar_bsp;                                 \
       (CONTEXT)->pr = sc_->sc_pr;                                      \
       (CONTEXT)->psp = sc_->sc_gr[12];                                 \
+      (CONTEXT)->gp = sc_->sc_gr[1];                                   \
+      /* Signal frame doesn't have an associated reg. stack frame      \
+         other than what we adjust for below.    */                    \
+      (FS) -> no_reg_stack_frame = 1;                                  \
                                                                        \
-      /* Don't touch the branch registers.  The kernel doesn't         \
+      /* Don't touch the branch registers o.t. b0.  The kernel doesn't \
         pass the preserved branch registers in the sigcontext but      \
         leaves them intact, so there's no need to do anything          \
         with them here.  */                                            \
index b9bcf48..52db9ac 100644 (file)
@@ -138,7 +138,7 @@ typedef struct unw_state_record
   unsigned int done : 1;               /* are we done scanning descriptors? */
   unsigned int any_spills : 1;         /* got any register spills? */
   unsigned int in_body : 1;    /* are we inside a body? */
-
+  unsigned int no_reg_stack_frame : 1; /* Don't adjust bsp for i&l regs */
   unsigned char *imask;                /* imask of of spill_mask record or NULL */
   unsigned long pr_val;                /* predicate values */
   unsigned long pr_mask;       /* predicate mask */
@@ -192,9 +192,12 @@ struct _Unwind_Context
   void *lsda;                  /* language specific data area */
 
   /* Preserved state.  */
-  unsigned long *bsp_loc;      /* previous bsp save location */
+  unsigned long *bsp_loc;      /* previous bsp save location
+                                  Appears to be write-only?    */
   unsigned long *bspstore_loc;
-  unsigned long *pfs_loc;
+  unsigned long *pfs_loc;      /* Save location for pfs in current
+                                  (corr. to sp) frame.  Target
+                                  contains cfm for caller.     */
   unsigned long *pri_unat_loc;
   unsigned long *unat_loc;
   unsigned long *lc_loc;
@@ -1510,8 +1513,11 @@ uw_frame_state_for (struct _Unwind_Context *context, _Unwind_FrameState *fs)
   unsigned long *unw, header, length;
   unsigned char *insn, *insn_end;
   unsigned long segment_base;
+  struct unw_reg_info *r;
 
   memset (fs, 0, sizeof (*fs));
+  for (r = fs->curr.reg; r < fs->curr.reg + UNW_NUM_REGS; ++r)
+    r->when = UNW_WHEN_NEVER;
   context->lsda = 0;
 
   ent = _Unwind_FindTableEntry ((void *) context->rp,
@@ -1769,7 +1775,10 @@ uw_update_context (struct _Unwind_Context *context, _Unwind_FrameState *fs)
 
   /* Unwind BSP for the local registers allocated this frame.  */
   /* ??? What to do with stored BSP or BSPSTORE registers.  */
-  if (fs->when_target > fs->curr.reg[UNW_REG_PFS].when)
+  /* We assert that we are either at a call site, or we have
+     just unwound through a signal frame.  In either case
+     pfs_loc is valid. */
+  if (!(fs -> no_reg_stack_frame))
     {
       unsigned long pfs = *context->pfs_loc;
       unsigned long sol = (pfs >> 7) & 0x7f;