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]

Re: PATCH: Fix member.C on IRIX 6.5


Looks like you'll need the following as well.  Damn Pmode < word_mode.
With this I can manually run g++.brenden/eh1.C.  


r~


Index: unwind-dw2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/unwind-dw2.c,v
retrieving revision 1.2.2.2
diff -c -p -d -r1.2.2.2 unwind-dw2.c
*** unwind-dw2.c	2001/05/16 19:29:55	1.2.2.2
--- unwind-dw2.c	2001/05/18 17:13:25
*************** extract_cie_info (struct dwarf_cie *cie,
*** 218,232 ****
    const unsigned char *aug = cie->augmentation;
    const unsigned char *p = aug + strlen (aug) + 1;
    const unsigned char *ret = NULL;
!   _Unwind_Word code_align;
!   _Unwind_Sword data_align;
  
    /* Immediately following the augmentation are the code and
       data alignment and return address column.  */
!   p = read_uleb128 (p, &code_align);
!   p = read_sleb128 (p, &data_align);
!   fs->code_align = code_align;
!   fs->data_align = data_align;
    fs->retaddr_column = *p++;
    fs->lsda_encoding = DW_EH_PE_omit;
  
--- 218,229 ----
    const unsigned char *aug = cie->augmentation;
    const unsigned char *p = aug + strlen (aug) + 1;
    const unsigned char *ret = NULL;
!   _Unwind_Ptr tmp;
  
    /* Immediately following the augmentation are the code and
       data alignment and return address column.  */
!   p = read_uleb128 (p, &tmp); fs->code_align = tmp;
!   p = read_sleb128 (p, &tmp); fs->data_align = (saddr) tmp;
    fs->retaddr_column = *p++;
    fs->lsda_encoding = DW_EH_PE_omit;
  
*************** extract_cie_info (struct dwarf_cie *cie,
*** 235,243 ****
       the size.  */
    if (*aug == 'z')
      {
!       _Unwind_Word i;
!       p = read_uleb128 (p, &i);
!       ret = p + i;
  
        fs->saw_z = 1;
        ++aug;
--- 232,239 ----
       the size.  */
    if (*aug == 'z')
      {
!       p = read_uleb128 (p, &tmp);
!       ret = p + tmp;
  
        fs->saw_z = 1;
        ++aug;
*************** execute_stack_op (const unsigned char *o
*** 303,308 ****
--- 299,305 ----
        enum dwarf_location_atom op = *op_ptr++;
        _Unwind_Word result, reg;
        _Unwind_Sword offset;
+       _Unwind_Ptr ptrtmp;
  
        switch (op)
  	{
*************** execute_stack_op (const unsigned char *o
*** 379,389 ****
  	  op_ptr += 8;
  	  break;
  	case DW_OP_constu:
! 	  op_ptr = read_uleb128 (op_ptr, &result);
  	  break;
  	case DW_OP_consts:
! 	  op_ptr = read_sleb128 (op_ptr, &offset);
! 	  result = offset;
  	  break;
  
  	case DW_OP_reg0:
--- 376,387 ----
  	  op_ptr += 8;
  	  break;
  	case DW_OP_constu:
! 	  op_ptr = read_uleb128 (op_ptr, &ptrtmp);
! 	  result = ptrtmp;
  	  break;
  	case DW_OP_consts:
! 	  op_ptr = read_sleb128 (op_ptr, &ptrtmp);
! 	  result = (saddr)ptrtmp;
  	  break;
  
  	case DW_OP_reg0:
*************** execute_stack_op (const unsigned char *o
*** 421,427 ****
  	  result = _Unwind_GetGR (context, op - DW_OP_reg0);
  	  break;
  	case DW_OP_regx:
! 	  op_ptr = read_uleb128 (op_ptr, &reg);
  	  result = _Unwind_GetGR (context, reg);
  	  break;
  
--- 419,425 ----
  	  result = _Unwind_GetGR (context, op - DW_OP_reg0);
  	  break;
  	case DW_OP_regx:
! 	  op_ptr = read_uleb128 (op_ptr, &ptrtmp); reg = ptrtmp;
  	  result = _Unwind_GetGR (context, reg);
  	  break;
  
*************** execute_stack_op (const unsigned char *o
*** 457,468 ****
  	case DW_OP_breg29:
  	case DW_OP_breg30:
  	case DW_OP_breg31:
! 	  op_ptr = read_sleb128 (op_ptr, &offset);
  	  result = _Unwind_GetGR (context, op - DW_OP_breg0) + offset;
  	  break;
  	case DW_OP_bregx:
! 	  op_ptr = read_uleb128 (op_ptr, &reg);
! 	  op_ptr = read_sleb128 (op_ptr, &offset);
  	  result = _Unwind_GetGR (context, reg) + offset;
  	  break;
  
--- 455,466 ----
  	case DW_OP_breg29:
  	case DW_OP_breg30:
  	case DW_OP_breg31:
! 	  op_ptr = read_sleb128 (op_ptr, &ptrtmp); offset = (saddr)ptrtmp;
  	  result = _Unwind_GetGR (context, op - DW_OP_breg0) + offset;
  	  break;
  	case DW_OP_bregx:
! 	  op_ptr = read_uleb128 (op_ptr, &ptrtmp); reg = ptrtmp;
! 	  op_ptr = read_sleb128 (op_ptr, &ptrtmp); offset = (saddr)ptrtmp;
  	  result = _Unwind_GetGR (context, reg) + offset;
  	  break;
  
*************** execute_stack_op (const unsigned char *o
*** 559,565 ****
  	      result = ~result;
  	      break;
  	    case DW_OP_plus_uconst:
! 	      op_ptr = read_uleb128 (op_ptr, &reg);
  	      result += reg;
  	      break;
  	    }
--- 557,563 ----
  	      result = ~result;
  	      break;
  	    case DW_OP_plus_uconst:
! 	      op_ptr = read_uleb128 (op_ptr, &ptrtmp); reg = ptrtmp;
  	      result += reg;
  	      break;
  	    }
*************** execute_cfa_program (const unsigned char
*** 698,713 ****
    while (insn_ptr < insn_end && fs->pc < context->ra)
      {
        unsigned char insn = *insn_ptr++;
!       _Unwind_Word reg, uoffset;
        _Unwind_Sword offset;
  
        if (insn & DW_CFA_advance_loc)
  	fs->pc += (insn & 0x3f) * fs->code_align;
        else if (insn & DW_CFA_offset)
  	{
  	  reg = insn & 0x3f;
! 	  insn_ptr = read_uleb128 (insn_ptr, &uoffset);
! 	  offset = (_Unwind_Sword)uoffset * fs->data_align;
  	  fs->regs.reg[reg].how = REG_SAVED_OFFSET;
  	  fs->regs.reg[reg].loc.offset = offset;
  	}
--- 696,712 ----
    while (insn_ptr < insn_end && fs->pc < context->ra)
      {
        unsigned char insn = *insn_ptr++;
!       _Unwind_Word reg;
        _Unwind_Sword offset;
+       _Unwind_Ptr ptrtmp;
  
        if (insn & DW_CFA_advance_loc)
  	fs->pc += (insn & 0x3f) * fs->code_align;
        else if (insn & DW_CFA_offset)
  	{
  	  reg = insn & 0x3f;
! 	  insn_ptr = read_uleb128 (insn_ptr, &ptrtmp);
! 	  offset = ptrtmp * fs->data_align;
  	  fs->regs.reg[reg].how = REG_SAVED_OFFSET;
  	  fs->regs.reg[reg].loc.offset = offset;
  	}
*************** execute_cfa_program (const unsigned char
*** 724,751 ****
  	  break;
  
  	case DW_CFA_advance_loc1:
! 	  fs->pc += read_1u (insn_ptr);
  	  insn_ptr += 1;
  	  break;
  	case DW_CFA_advance_loc2:
! 	  fs->pc += read_2u (insn_ptr);
  	  insn_ptr += 2;
  	  break;
  	case DW_CFA_advance_loc4:
! 	  fs->pc += read_4u (insn_ptr);
  	  insn_ptr += 4;
  	  break;
  
  	case DW_CFA_offset_extended:
! 	  insn_ptr = read_uleb128 (insn_ptr, &reg);
! 	  insn_ptr = read_uleb128 (insn_ptr, &uoffset);
! 	  offset = (_Unwind_Sword)uoffset * fs->data_align;
  	  fs->regs.reg[reg].how = REG_SAVED_OFFSET;
  	  fs->regs.reg[reg].loc.offset = offset;
  	  break;
  
  	case DW_CFA_restore_extended:
! 	  insn_ptr = read_uleb128 (insn_ptr, &reg);
  	  fs->regs.reg[reg].how = REG_UNSAVED;
  	  break;
  
--- 723,750 ----
  	  break;
  
  	case DW_CFA_advance_loc1:
! 	  fs->pc += read_1u (insn_ptr) * fs->code_align;
  	  insn_ptr += 1;
  	  break;
  	case DW_CFA_advance_loc2:
! 	  fs->pc += read_2u (insn_ptr) * fs->code_align;
  	  insn_ptr += 2;
  	  break;
  	case DW_CFA_advance_loc4:
! 	  fs->pc += read_4u (insn_ptr) * fs->code_align;
  	  insn_ptr += 4;
  	  break;
  
  	case DW_CFA_offset_extended:
! 	  insn_ptr = read_uleb128 (insn_ptr, &ptrtmp); reg = ptrtmp;
! 	  insn_ptr = read_uleb128 (insn_ptr, &ptrtmp);
! 	  offset = ptrtmp * fs->data_align;
  	  fs->regs.reg[reg].how = REG_SAVED_OFFSET;
  	  fs->regs.reg[reg].loc.offset = offset;
  	  break;
  
  	case DW_CFA_restore_extended:
! 	  insn_ptr = read_uleb128 (insn_ptr, &ptrtmp); reg = ptrtmp;
  	  fs->regs.reg[reg].how = REG_UNSAVED;
  	  break;
  
*************** execute_cfa_program (const unsigned char
*** 757,764 ****
  	case DW_CFA_register:
  	  {
  	    _Unwind_Word reg2;
! 	    insn_ptr = read_uleb128 (insn_ptr, &reg);
! 	    insn_ptr = read_uleb128 (insn_ptr, &reg2);
  	    fs->regs.reg[reg].how = REG_SAVED_REG;
  	    fs->regs.reg[reg].loc.reg = reg2;
  	  }
--- 756,763 ----
  	case DW_CFA_register:
  	  {
  	    _Unwind_Word reg2;
! 	    insn_ptr = read_uleb128 (insn_ptr, &ptrtmp); reg = ptrtmp;
! 	    insn_ptr = read_uleb128 (insn_ptr, &ptrtmp); reg2 = ptrtmp;
  	    fs->regs.reg[reg].how = REG_SAVED_REG;
  	    fs->regs.reg[reg].loc.reg = reg2;
  	  }
*************** execute_cfa_program (const unsigned char
*** 790,844 ****
  	  break;
  
  	case DW_CFA_def_cfa:
! 	  insn_ptr = read_uleb128 (insn_ptr, &fs->cfa_reg);
! 	  insn_ptr = read_uleb128 (insn_ptr, &uoffset);
! 	  fs->cfa_offset = uoffset;
  	  fs->cfa_how = CFA_REG_OFFSET;
  	  break;
  
  	case DW_CFA_def_cfa_register:
! 	  insn_ptr = read_uleb128 (insn_ptr, &fs->cfa_reg);
  	  fs->cfa_how = CFA_REG_OFFSET;
  	  break;
  
  	case DW_CFA_def_cfa_offset:
! 	  insn_ptr = read_uleb128 (insn_ptr, &uoffset);
! 	  fs->cfa_offset = uoffset;
  	  /* cfa_how deliberately not set.  */
  	  break;
  
  	case DW_CFA_def_cfa_expression:
! 	  insn_ptr = read_uleb128 (insn_ptr, &uoffset);
  	  fs->cfa_exp = insn_ptr;
  	  fs->cfa_how = CFA_EXP;
! 	  insn_ptr += uoffset;
  	  break;
  
  	case DW_CFA_expression:
! 	  insn_ptr = read_uleb128 (insn_ptr, &reg);
! 	  insn_ptr = read_uleb128 (insn_ptr, &uoffset);
  	  fs->regs.reg[reg].how = REG_SAVED_EXP;
  	  fs->regs.reg[reg].loc.exp = insn_ptr;
! 	  insn_ptr += uoffset;
  	  break;
  
  	  /* From the 2.1 draft.  */
  	case DW_CFA_offset_extended_sf:
! 	  insn_ptr = read_uleb128 (insn_ptr, &reg);
! 	  insn_ptr = read_sleb128 (insn_ptr, &offset);
! 	  offset *= fs->data_align;
  	  fs->regs.reg[reg].how = REG_SAVED_OFFSET;
  	  fs->regs.reg[reg].loc.offset = offset;
  	  break;
  	  
  	case DW_CFA_def_cfa_sf:
! 	  insn_ptr = read_uleb128 (insn_ptr, &fs->cfa_reg);
! 	  insn_ptr = read_sleb128 (insn_ptr, &fs->cfa_offset);
  	  fs->cfa_how = CFA_REG_OFFSET;
  	  break;
  
  	case DW_CFA_def_cfa_offset_sf:
! 	  insn_ptr = read_uleb128 (insn_ptr, &fs->cfa_offset);
  	  /* cfa_how deliberately not set.  */
  	  break;
  
--- 789,848 ----
  	  break;
  
  	case DW_CFA_def_cfa:
! 	  insn_ptr = read_uleb128 (insn_ptr, &ptrtmp);
! 	  fs->cfa_reg = ptrtmp;
! 	  insn_ptr = read_uleb128 (insn_ptr, &ptrtmp);
! 	  fs->cfa_offset = ptrtmp;
  	  fs->cfa_how = CFA_REG_OFFSET;
  	  break;
  
  	case DW_CFA_def_cfa_register:
! 	  insn_ptr = read_uleb128 (insn_ptr, &ptrtmp);
! 	  fs->cfa_reg = ptrtmp;
  	  fs->cfa_how = CFA_REG_OFFSET;
  	  break;
  
  	case DW_CFA_def_cfa_offset:
! 	  insn_ptr = read_uleb128 (insn_ptr, &ptrtmp);
! 	  fs->cfa_offset = ptrtmp;
  	  /* cfa_how deliberately not set.  */
  	  break;
  
  	case DW_CFA_def_cfa_expression:
! 	  insn_ptr = read_uleb128 (insn_ptr, &ptrtmp);
  	  fs->cfa_exp = insn_ptr;
  	  fs->cfa_how = CFA_EXP;
! 	  insn_ptr += ptrtmp;
  	  break;
  
  	case DW_CFA_expression:
! 	  insn_ptr = read_uleb128 (insn_ptr, &ptrtmp); reg = ptrtmp;
! 	  insn_ptr = read_uleb128 (insn_ptr, &ptrtmp);
  	  fs->regs.reg[reg].how = REG_SAVED_EXP;
  	  fs->regs.reg[reg].loc.exp = insn_ptr;
! 	  insn_ptr += ptrtmp;
  	  break;
  
  	  /* From the 2.1 draft.  */
  	case DW_CFA_offset_extended_sf:
! 	  insn_ptr = read_uleb128 (insn_ptr, &ptrtmp); reg = ptrtmp;
! 	  insn_ptr = read_sleb128 (insn_ptr, &ptrtmp);
! 	  offset = (saddr)ptrtmp * fs->data_align;
  	  fs->regs.reg[reg].how = REG_SAVED_OFFSET;
  	  fs->regs.reg[reg].loc.offset = offset;
  	  break;
  	  
  	case DW_CFA_def_cfa_sf:
! 	  insn_ptr = read_uleb128 (insn_ptr, &ptrtmp);
! 	  fs->cfa_reg = ptrtmp;
! 	  insn_ptr = read_sleb128 (insn_ptr, &ptrtmp);
! 	  fs->cfa_offset = (saddr)ptrtmp;
  	  fs->cfa_how = CFA_REG_OFFSET;
  	  break;
  
  	case DW_CFA_def_cfa_offset_sf:
! 	  insn_ptr = read_uleb128 (insn_ptr, &ptrtmp);
! 	  fs->cfa_offset = ptrtmp;
  	  /* cfa_how deliberately not set.  */
  	  break;
  
*************** execute_cfa_program (const unsigned char
*** 852,866 ****
  	  break;
  
  	case DW_CFA_GNU_args_size:
! 	  insn_ptr = read_uleb128 (insn_ptr, &context->args_size);
  	  break;
  
  	case DW_CFA_GNU_negative_offset_extended:
  	  /* Obsoleted by DW_CFA_offset_extended_sf, but used by
  	     older PowerPC code.  */
! 	  insn_ptr = read_uleb128 (insn_ptr, &reg);
! 	  insn_ptr = read_uleb128 (insn_ptr, &uoffset);
! 	  offset = (_Unwind_Sword)uoffset * fs->data_align;
  	  fs->regs.reg[reg].how = REG_SAVED_OFFSET;
  	  fs->regs.reg[reg].loc.offset = -offset;
  	  break;
--- 856,871 ----
  	  break;
  
  	case DW_CFA_GNU_args_size:
! 	  insn_ptr = read_uleb128 (insn_ptr, &ptrtmp);
! 	  context->args_size = ptrtmp;
  	  break;
  
  	case DW_CFA_GNU_negative_offset_extended:
  	  /* Obsoleted by DW_CFA_offset_extended_sf, but used by
  	     older PowerPC code.  */
! 	  insn_ptr = read_uleb128 (insn_ptr, &ptrtmp); reg = ptrtmp;
! 	  insn_ptr = read_uleb128 (insn_ptr, &ptrtmp);
! 	  offset = ptrtmp * fs->data_align;
  	  fs->regs.reg[reg].how = REG_SAVED_OFFSET;
  	  fs->regs.reg[reg].loc.offset = -offset;
  	  break;
*************** uw_frame_state_for (struct _Unwind_Conte
*** 916,922 ****
    insn = NULL;
    if (fs->saw_z)
      {
!       _Unwind_Word i;
        aug = read_uleb128 (aug, &i);
        insn = aug + i;
      }
--- 921,927 ----
    insn = NULL;
    if (fs->saw_z)
      {
!       _Unwind_Ptr i;
        aug = read_uleb128 (aug, &i);
        insn = aug + i;
      }
*************** uw_update_context_1 (struct _Unwind_Cont
*** 964,970 ****
  	 that this will not be a problem.  */
        {
  	const unsigned char *exp = fs->cfa_exp;
! 	_Unwind_Word len;
  
  	exp = read_uleb128 (exp, &len);
  	cfa = (void *) (_Unwind_Ptr)
--- 969,975 ----
  	 that this will not be a problem.  */
        {
  	const unsigned char *exp = fs->cfa_exp;
! 	_Unwind_Ptr len;
  
  	exp = read_uleb128 (exp, &len);
  	cfa = (void *) (_Unwind_Ptr)
*************** uw_update_context_1 (struct _Unwind_Cont
*** 992,998 ****
        case REG_SAVED_EXP:
  	{
  	  const unsigned char *exp = fs->regs.reg[i].loc.exp;
! 	  _Unwind_Word len;
  	  _Unwind_Ptr val;
  
  	  exp = read_uleb128 (exp, &len);
--- 997,1003 ----
        case REG_SAVED_EXP:
  	{
  	  const unsigned char *exp = fs->regs.reg[i].loc.exp;
! 	  _Unwind_Ptr len;
  	  _Unwind_Ptr val;
  
  	  exp = read_uleb128 (exp, &len);
Index: unwind.inc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/unwind.inc,v
retrieving revision 1.1.2.1
diff -c -p -d -r1.1.2.1 unwind.inc
*** unwind.inc	2001/05/13 07:10:02	1.1.2.1
--- unwind.inc	2001/05/18 17:13:25
*************** static _Unwind_Reason_Code
*** 135,142 ****
  _Unwind_ForcedUnwind_Phase2(struct _Unwind_Exception *exc,
  			    struct _Unwind_Context *context)
  {
!   _Unwind_Stop_Fn stop = (_Unwind_Stop_Fn) exc->private_1;
!   void *stop_argument = (void *) exc->private_2;
    _Unwind_Reason_Code code, stop_code;
  
    while (1)
--- 135,142 ----
  _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;
    _Unwind_Reason_Code code, stop_code;
  
    while (1)


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