From: hboehm Date: Tue, 26 Mar 2002 21:27:12 +0000 (+0000) Subject: * config/ia64/linux.h (MD_FALLBACK_FRAME_STATE_FOR): X-Git-Tag: upstream/4.9.2~87730 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8546dce905d1083b2ef8e94b0435bff38466b590;p=platform%2Fupstream%2Flinaro-gcc.git * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51407 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 90b3bab..df46d03 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2002-03-26 Hans Boehm + * 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 * config/rs6000/aix51.h (WCHAR_TYPE): Define. diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h index 1889ef6..ac77af2 100644 --- a/gcc/config/ia64/linux.h +++ b/gcc/config/ia64/linux.h @@ -98,10 +98,16 @@ (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. */ \ diff --git a/gcc/config/ia64/unwind-ia64.c b/gcc/config/ia64/unwind-ia64.c index b9bcf48..52db9ac 100644 --- a/gcc/config/ia64/unwind-ia64.c +++ b/gcc/config/ia64/unwind-ia64.c @@ -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;