summaryrefslogtreecommitdiff
path: root/gdb/remote-mips.c
diff options
context:
space:
mode:
authorMarkus Deuling <deuling@de.ibm.com>2008-07-14 11:25:12 +0000
committerMarkus Deuling <deuling@de.ibm.com>2008-07-14 11:25:12 +0000
commit352ab6de8998d623ccd2251efbdfecc4c0bde920 (patch)
tree3e8adf8c32e2915b6e678dc0772147cbbf6514a8 /gdb/remote-mips.c
parent1b4b4b2e52c4f78db3c39a4eab2ba45954b63eb2 (diff)
downloadgdb-352ab6de8998d623ccd2251efbdfecc4c0bde920.tar.gz
* mips-tdep.c (fp_register_arg_p): Add gdbarch as paramter.
(mips_n32n64_push_dummy_call, mips_o64_return_value) (mips_eabi_push_dummy_call): Update call to fp_register_arg_p. (MIPS_FPU_TYPE): Add gdbarch as parameter and replace current_gdbarch. (fp_register_arg_p, mips_dump_tdep, show_mipsfpu_command) (mips_n32n64_fp_arg_chunk_p): Update caller. (mips_n32n64_fp_arg_chunk_p): Add gdbarch as paramter. (mips_n32n64_push_dummy_call): Update caller. (MIPS_LAST_ARG_REGNUM): Add gdbarch as parameter and replace current_gdbarch. (mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call) (mips_o32_push_dummy_call, mips_o64_push_dummy_call): Update caller. (MIPS_LAST_FP_ARG_REGNUM): Add gdbarch as parameter and replace current_gdbarch. (mips_eabi_push_dummy_call, mips_o32_push_dummy_call) (mips_o64_push_dummy_call): Update caller. (MIPS_EABI): Add gdbarch as parameter and replace current_gdbarch. (fp_register_arg_p, mips_dump_tdep): Update caller. (set_reg_offset): Add gdbarch as parameter and replace current_gdbarch. (mips16_scan_prologue, mips32_scan_prologue): Update caller. (reset_saved_regs): Make static. Add gdbarch as parameter. Replace current_gdbarch. (mips32_scan_prologue): Update caller. (heuristic_proc_start): Add gdbarch as parameter. Replace current_gdbarch. (mips_insn16_frame_cache, mips_insn32_frame_cache): Update caller. * mipsnbsd-nat.c (mipsnbsd_fetch_inferior_registers) (mipsnbsd_store_inferior_registers): Use get_regcache_arch to get at the current architecture. Update call to getregs_supplies. (getregs_supplies): Add gdbarch as parameter and replace current_gdbarch. * mipsnbsd-tdep.c (mipsnbsd_get_longjmp_target): Use get_frame_arch to get at the current architecture. Update call to NBSD_MIPS_JB_OFFSET and NBSD_MIPS_JB_ELEMENT_SIZE. (NBSD_MIPS_JB_ELEMENT_SIZE, NBSD_MIPS_JB_OFFSET): Add gdbarch and replace current_gdbarch. * remote-mips.c (mips_map_regno): Add gdbarch as parameter and replace current_gdbarch. (mips_fetch_registers, mips_store_registers): Update call to mips_map_regno. (mips_load): Use get_regcache_arch to get at the current_architecture and replace current_gdbarch.
Diffstat (limited to 'gdb/remote-mips.c')
-rw-r--r--gdb/remote-mips.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index 3cbf8a0a315..df17051985a 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -92,7 +92,7 @@ static void mips_resume (ptid_t ptid, int step,
static ptid_t mips_wait (ptid_t ptid,
struct target_waitstatus *status);
-static int mips_map_regno (int regno);
+static int mips_map_regno (struct gdbarch *, int);
static void mips_fetch_registers (struct regcache *regcache, int regno);
@@ -1875,24 +1875,24 @@ mips_wait (ptid_t ptid, struct target_waitstatus *status)
#define REGNO_OFFSET 96
static int
-mips_map_regno (int regno)
+mips_map_regno (struct gdbarch *gdbarch, int regno)
{
if (regno < 32)
return regno;
- if (regno >= mips_regnum (current_gdbarch)->fp0
- && regno < mips_regnum (current_gdbarch)->fp0 + 32)
- return regno - mips_regnum (current_gdbarch)->fp0 + 32;
- else if (regno == mips_regnum (current_gdbarch)->pc)
+ if (regno >= mips_regnum (gdbarch)->fp0
+ && regno < mips_regnum (gdbarch)->fp0 + 32)
+ return regno - mips_regnum (gdbarch)->fp0 + 32;
+ else if (regno == mips_regnum (gdbarch)->pc)
return REGNO_OFFSET + 0;
- else if (regno == mips_regnum (current_gdbarch)->cause)
+ else if (regno == mips_regnum (gdbarch)->cause)
return REGNO_OFFSET + 1;
- else if (regno == mips_regnum (current_gdbarch)->hi)
+ else if (regno == mips_regnum (gdbarch)->hi)
return REGNO_OFFSET + 2;
- else if (regno == mips_regnum (current_gdbarch)->lo)
+ else if (regno == mips_regnum (gdbarch)->lo)
return REGNO_OFFSET + 3;
- else if (regno == mips_regnum (current_gdbarch)->fp_control_status)
+ else if (regno == mips_regnum (gdbarch)->fp_control_status)
return REGNO_OFFSET + 4;
- else if (regno == mips_regnum (current_gdbarch)->fp_implementation_revision)
+ else if (regno == mips_regnum (gdbarch)->fp_implementation_revision)
return REGNO_OFFSET + 5;
else
/* FIXME: Is there a way to get the status register? */
@@ -1924,7 +1924,7 @@ mips_fetch_registers (struct regcache *regcache, int regno)
{
/* If PMON doesn't support this register, don't waste serial
bandwidth trying to read it. */
- int pmon_reg = mips_map_regno (regno);
+ int pmon_reg = mips_map_regno (gdbarch, regno);
if (regno != 0 && pmon_reg == 0)
val = 0;
else
@@ -1979,7 +1979,7 @@ mips_store_registers (struct regcache *regcache, int regno)
}
regcache_cooked_read_unsigned (regcache, regno, &val);
- mips_request ('R', mips_map_regno (regno), val,
+ mips_request ('R', mips_map_regno (gdbarch, regno), val,
&err, mips_receive_wait, NULL);
if (err)
mips_error ("Can't write register %d: %s", regno, safe_strerror (errno));
@@ -3281,8 +3281,10 @@ mips_load (char *file, int from_tty)
/* Work around problem where PMON monitor updates the PC after a load
to a different value than GDB thinks it has. The following ensures
that the write_pc() WILL update the PC value: */
- regcache_set_valid_p (get_current_regcache (),
- gdbarch_pc_regnum (current_gdbarch), 0);
+ struct regcache *regcache = get_current_regcache ();
+ regcache_set_valid_p (regcache,
+ gdbarch_pc_regnum (get_regcache_arch (regcache)),
+ 0);
}
if (exec_bfd)
write_pc (bfd_get_start_address (exec_bfd));