* mips-tdep.c (mips_fetch_instruction, mips16_fetch_instruction)

(mips_mdebug_frame_cache, mips16_scan_prologue)
(mips32_scan_prologue, mips_stub_frame_cache)
(heuristic_proc_start, heuristic_proc_desc)
(mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call)
(mips_n32n64_return_value, mips_o32_push_dummy_call)
(mips_o32_return_value, mips_o64_push_dummy_call)
(mips_step_skips_delay, mips_skip_trampoline_code)
(mips_gdbarch_init): Use MIPS_A0_REGNUM instead of A0_REGNUM,
MIPS_RA_REGNUM instead of RA_REGNUM, MIPS_T9_REGNUM instead of
T9_REGNUM, MIPS_V0_REGNUM instead of V0_REGNUM, MIPS_ZERO_REGNUM
instead of ZERO_REGNUM, MIPS32_SIZE_INSN instead of MIPS_INSTLEN
and MIPS16_INSN_SIZE instead of MIPS16_INSTLEN.
(mips_dump_tdep): Don't print A0_REGNUM, RA_REGNUM,
T9_REGNUM, V0_REGNUM, ZERO_REGNUM, MIPS_INSTLEN and
MIPS16_INSTLEN.  Use MIPS_A0_REGNUM instead of A0_REGNUM.
* mips-linux-tdep.c (mips_linux_o32_sigframe_init)
(mips_linux_n32n64_sigframe_init): Use MIPS_ZERO_REGNUM instead of
ZERO_REGNUM.
* mipsnbsd-tdep.c (mipsnbsd_cannot_fetch_register)
(mipsnbsd_cannot_store_register): Use MIPS_ZERO_REGNUM instead of
ZERO_REGNUM.
(mipsnbsd_get_longjmp_target): Use MIPS_A0_REGNUM instead of
A0_REGNUM.
* mipsnbsd-nat.c: Include "mips-tdep.h".
(getregs_supplies): Use MIPS_ZERO_REGNUM instead of ZERO_REGNUM.
* Makefile.in (mipsnbsd-nat.o): Update dependencies.
This commit is contained in:
Mark Kettenis 2004-10-30 14:31:19 +00:00
parent 1c8831c5ad
commit 4c7d22cba3
5 changed files with 68 additions and 77 deletions

View file

@ -26,6 +26,8 @@
#include "value.h"
#include "osabi.h"
#include "gdb_string.h"
#include "nbsd-tdep.h"
#include "mipsnbsd-tdep.h"
#include "mips-tdep.h"
@ -194,15 +196,16 @@ static const unsigned char sigtramp_retcode_mipseb[RETCODE_SIZE] =
};
static LONGEST
mipsnbsd_sigtramp_offset (CORE_ADDR pc)
mipsnbsd_sigtramp_offset (struct frame_info *next_frame)
{
CORE_ADDR pc = frame_pc_unwind (next_frame);
const char *retcode = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
? sigtramp_retcode_mipseb : sigtramp_retcode_mipsel;
unsigned char ret[RETCODE_SIZE], w[4];
LONGEST off;
int i;
if (deprecated_read_memory_nobpt (pc, (char *) w, sizeof (w)) != 0)
if (!safe_frame_unwind_memory (next_frame, pc, w, sizeof (w)))
return -1;
for (i = 0; i < RETCODE_NWORDS; i++)
@ -216,7 +219,7 @@ mipsnbsd_sigtramp_offset (CORE_ADDR pc)
off = i * 4;
pc -= off;
if (deprecated_read_memory_nobpt (pc, (char *) ret, sizeof (ret)) != 0)
if (!safe_frame_unwind_memory (next_frame, pc, ret, sizeof (ret)))
return -1;
if (memcmp (ret, retcode, RETCODE_SIZE) == 0)
@ -226,8 +229,8 @@ mipsnbsd_sigtramp_offset (CORE_ADDR pc)
}
/* Figure out where the longjmp will land. We expect that we have
just entered longjmp and haven't yet setup the stack frame, so
the args are still in the argument regs. A0_REGNUM points at the
just entered longjmp and haven't yet setup the stack frame, so the
args are still in the argument regs. MIPS_A0_REGNUM points at the
jmp_buf structure from which we extract the PC that we will land
at. The PC is copied into *pc. This routine returns true on
success. */
@ -245,7 +248,7 @@ mipsnbsd_get_longjmp_target (CORE_ADDR *pc)
buf = alloca (NBSD_MIPS_JB_ELEMENT_SIZE);
jb_addr = read_register (A0_REGNUM);
jb_addr = read_register (MIPS_A0_REGNUM);
if (target_read_memory (jb_addr + NBSD_MIPS_JB_OFFSET, buf,
NBSD_MIPS_JB_ELEMENT_SIZE))
@ -259,14 +262,14 @@ mipsnbsd_get_longjmp_target (CORE_ADDR *pc)
static int
mipsnbsd_cannot_fetch_register (int regno)
{
return (regno == ZERO_REGNUM
return (regno == MIPS_ZERO_REGNUM
|| regno == mips_regnum (current_gdbarch)->fp_implementation_revision);
}
static int
mipsnbsd_cannot_store_register (int regno)
{
return (regno == ZERO_REGNUM
return (regno == MIPS_ZERO_REGNUM
|| regno == mips_regnum (current_gdbarch)->fp_implementation_revision);
}
@ -289,7 +292,7 @@ mipsnbsd_ilp32_solib_svr4_fetch_link_map_offsets (void)
lmo.link_map_size = 24;
lmo.l_addr_offset = 0;
lmo.l_addr_offset = 4;
lmo.l_addr_size = 4;
lmo.l_name_offset = 8;