mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-12-22 19:43:42 +01:00
mipsN32: A modification suggestion to support mips N32
This commit is contained in:
parent
2be1c2754a
commit
fba2ae7b2c
4 changed files with 19 additions and 2 deletions
|
@ -98,7 +98,7 @@ typedef enum
|
|||
UNW_MIPS_R30,
|
||||
UNW_MIPS_R31,
|
||||
|
||||
UNW_MIPS_PC = 34,
|
||||
UNW_MIPS_PC = 64,
|
||||
|
||||
/* FIXME: Other registers! */
|
||||
|
||||
|
|
|
@ -247,6 +247,14 @@ dwarf_get (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t *val)
|
|||
0, c->as_arg);
|
||||
else if (c->as->abi == UNW_MIPS_ABI_O32)
|
||||
return read_s32 (c, DWARF_GET_LOC (loc), val);
|
||||
else if (c->as->abi == UNW_MIPS_ABI_N32) {
|
||||
if (tdep_big_endian(c->as))
|
||||
return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc) + 4, val,
|
||||
0, c->as_arg);
|
||||
else
|
||||
return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), val,
|
||||
0, c->as_arg);
|
||||
}
|
||||
else
|
||||
return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), val,
|
||||
0, c->as_arg);
|
||||
|
|
|
@ -58,7 +58,15 @@ unw_create_addr_space (unw_accessors_t *a, int byte_order)
|
|||
as->big_endian = (byte_order == __BIG_ENDIAN);
|
||||
|
||||
/* FIXME! There is no way to specify the ABI. */
|
||||
#if _MIPS_SIM == _ABIO32
|
||||
as->abi = UNW_MIPS_ABI_O32;
|
||||
#elif _MIPS_SIM == _ABIN32
|
||||
as->abi = UNW_MIPS_ABI_N32;
|
||||
#elif _MIPS_SIM == _ABI64
|
||||
as->abi = UNW_MIPS_ABI_N64;
|
||||
#else
|
||||
# error Unsupported ABI
|
||||
#endif
|
||||
as->addr_size = 4;
|
||||
|
||||
return as;
|
||||
|
|
|
@ -63,7 +63,7 @@ tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp,
|
|||
case UNW_MIPS_R26:
|
||||
case UNW_MIPS_R27:
|
||||
case UNW_MIPS_R28:
|
||||
case UNW_MIPS_R29:
|
||||
|
||||
case UNW_MIPS_R30:
|
||||
case UNW_MIPS_R31:
|
||||
loc = c->dwarf.loc[reg - UNW_MIPS_R0];
|
||||
|
@ -75,6 +75,7 @@ tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp,
|
|||
loc = c->dwarf.loc[reg];
|
||||
break;
|
||||
|
||||
case UNW_MIPS_R29:
|
||||
case UNW_MIPS_CFA:
|
||||
if (write)
|
||||
return -UNW_EREADONLYREG;
|
||||
|
|
Loading…
Reference in a new issue