linux-unwind.h (mips_fallback_frame_state): Rewrite return address calculation.

* config/mips/linux-unwind.h (mips_fallback_frame_state): Rewrite
	return address calculation.  Substitute DWARF_ALT_FRAME_RETURN_COLUMN
	for SIGNAL_UNWIND_RETURN_COLUMN.
	* config/mips/mips.h (SIGNAL_UNWIND_RETURN_COLUMN): Remove.
	(DWARF_FRAME_REGNUM): Rewrite.
	(DWARF_ALT_FRAME_RETURN_COLUMN) Define.

From-SVN: r126555
This commit is contained in:
David Daney 2007-07-11 16:56:54 +00:00 committed by David Daney
parent 9251d66467
commit aa3e18a066
3 changed files with 24 additions and 13 deletions

View File

@ -1,3 +1,12 @@
2007-07-11 David Daney <ddaney@avtrex.com>
* config/mips/linux-unwind.h (mips_fallback_frame_state): Rewrite
return address calculation. Substitute DWARF_ALT_FRAME_RETURN_COLUMN
for SIGNAL_UNWIND_RETURN_COLUMN.
* config/mips/mips.h (SIGNAL_UNWIND_RETURN_COLUMN): Remove.
(DWARF_FRAME_REGNUM): Rewrite.
(DWARF_ALT_FRAME_RETURN_COLUMN) Define.
2007-07-11 Nick Clifton <nickc@redhat.com>
* config/m32r/m32r.h (INITIALIZE_TRAMPOLINE): Revert previous

View File

@ -1,5 +1,5 @@
/* DWARF2 EH unwinding support for MIPS Linux.
Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
This file is part of GCC.
@ -51,7 +51,6 @@ mips_fallback_frame_state (struct _Unwind_Context *context,
_Unwind_FrameState *fs)
{
u_int32_t *pc = (u_int32_t *) context->ra;
u_int32_t t;
struct sigcontext *sc;
_Unwind_Ptr new_cfa;
int i;
@ -106,11 +105,10 @@ mips_fallback_frame_state (struct _Unwind_Context *context,
/* The PC points to the faulting instruction, but the unwind tables
expect it point to the following instruction. We compensate by
reporting a return address at the next instruction. */
fs->regs.reg[SIGNAL_UNWIND_RETURN_COLUMN].how = REG_SAVED_VAL_OFFSET;
t = (*(u_int32_t *)(void *)&sc->sc_pc) + 4;
fs->regs.reg[SIGNAL_UNWIND_RETURN_COLUMN].loc.offset
= (_Unwind_Ptr)t - new_cfa;
fs->retaddr_column = SIGNAL_UNWIND_RETURN_COLUMN;
fs->regs.reg[DWARF_ALT_FRAME_RETURN_COLUMN].how = REG_SAVED_VAL_OFFSET;
fs->regs.reg[DWARF_ALT_FRAME_RETURN_COLUMN].loc.offset
= (_Unwind_Ptr)(sc->sc_pc) + 4 - new_cfa;
fs->retaddr_column = DWARF_ALT_FRAME_RETURN_COLUMN;
return _URC_NO_REASON;
}

View File

@ -1,6 +1,7 @@
/* Definitions of target machine for GNU compiler. MIPS version.
Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998
1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
Free Software Foundation, Inc.
Contributed by A. Lichnewsky (lich@inria.inria.fr).
Changed by Michael Meissner (meissner@osf.org).
64-bit r4000 support by Ian Lance Taylor (ian@cygnus.com) and
@ -1007,15 +1008,12 @@ extern const struct mips_rtx_cost_data *mips_cost;
#define DBX_REGISTER_NUMBER(REGNO) mips_dbx_regno[ (REGNO) ]
/* The mapping from gcc register number to DWARF 2 CFA column number. */
#define DWARF_FRAME_REGNUM(REG) (REG)
#define DWARF_FRAME_REGNUM(REG) \
((REG) == DWARF_ALT_FRAME_RETURN_COLUMN ? INVALID_REGNUM : (REG))
/* The DWARF 2 CFA column which tracks the return address. */
#define DWARF_FRAME_RETURN_COLUMN (GP_REG_FIRST + 31)
/* The DWARF 2 CFA column which tracks the return address from a
signal handler context. */
#define SIGNAL_UNWIND_RETURN_COLUMN (FP_REG_LAST + 1)
/* Before the prologue, RA lives in r31. */
#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (VOIDmode, GP_REG_FIRST + 31)
@ -1359,6 +1357,12 @@ extern const struct mips_rtx_cost_data *mips_cost;
#define MD_REG_NUM (MD_REG_LAST - MD_REG_FIRST + 1)
#define MD_DBX_FIRST (FP_DBX_FIRST + FP_REG_NUM)
/* The DWARF 2 CFA column which tracks the return address from a
signal handler context. This means that to maintain backwards
compatibility, no hard register can be assigned this column if it
would need to be handled by the DWARF unwinder. */
#define DWARF_ALT_FRAME_RETURN_COLUMN 66
#define ST_REG_FIRST 67
#define ST_REG_LAST 74
#define ST_REG_NUM (ST_REG_LAST - ST_REG_FIRST + 1)