summaryrefslogtreecommitdiff
path: root/gdb/remote-mips.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2007-10-10 17:04:38 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2007-10-10 17:04:38 +0000
commit2eb4d78bfd092cb2cf360e679bf8dcd7d212764a (patch)
tree288fb4bc4ece2130f6baddc2e400c95a174b8c2b /gdb/remote-mips.c
parent72a155b44d8601da263e2d4be0fe107a4d1e7f23 (diff)
downloadbinutils-gdb-2eb4d78bfd092cb2cf360e679bf8dcd7d212764a.tar.gz
2007-10-10 Markus Deuling <deuling@de.ibm.com>
* remote-mips.c (mips_wait, mips_fetch_registers) (mips_store_registers): Use get_regcache_arch to get at the current architecture by regcache. * mipsnbsd-tdep.c (mipsnbsd_supply_reg, mipsnbsd_fill_reg) (mipsnbsd_supply_fpreg, mipsnbsd_fill_fpreg): Use get_regcache_arch to get at the current architecture by regcache. (mipsnbsd_sigtramp_offset): Use get_frame_arch to get at the current architecture by frame_info. * mipsnbsd-nat.c (mipsnbsd_fetch_inferior_registers) (mipsnbsd_store_inferior_registers): Use get_regcache_arch to get at the current architecture by regcache. * mips-linux-tdep.c (mips_linux_get_longjmp_target) (mips64_linux_get_longjmp_target, mips_linux_o32_sigframe_init) (mips_linux_n32n64_sigframe_init): Use get_frame_arch to get at the current architecture by frame_info. (supply_32bit_reg, mips_supply_gregset, mips_fill_gregset) (mips_supply_fpregset, mips_fill_fpregset, supply_64bit_reg) (mips64_supply_gregset, mips64_fill_gregset, mips64_supply_fpregset) (mips64_fill_fpregset, mips_linux_write_pc): Use get_regcache_arch to get at the current architecture by regcache. * mips-linux-nat.c (mips_linux_register_addr) (mips64_linux_register_addr): Replace current_gdbarch by gdbarch. (supply_gregset, fill_gregset, supply_fpregset, fill_fpregset) (mips64_linux_regsets_fetch_registers) (mips64_linux_regsets_store_registers): Use get_regcache_arch to get at the current architecture by regcache. * mips64obsd-tdep.c (mips64obsd_sigframe_init): Use get_frame_arch to get at the current architecture by frame_info.
Diffstat (limited to 'gdb/remote-mips.c')
-rw-r--r--gdb/remote-mips.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index 0aee8431c38..f153fb4d034 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -1754,30 +1754,29 @@ mips_wait (ptid_t ptid, struct target_waitstatus *status)
if (nfields >= 3)
{
struct regcache *regcache = get_current_regcache ();
+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
char buf[MAX_REGISTER_SIZE];
store_unsigned_integer (buf,
register_size
- (current_gdbarch, gdbarch_pc_regnum
- (current_gdbarch)), rpc);
- regcache_raw_supply (regcache, gdbarch_pc_regnum (current_gdbarch), buf);
+ (gdbarch, gdbarch_pc_regnum (gdbarch)), rpc);
+ regcache_raw_supply (regcache, gdbarch_pc_regnum (gdbarch), buf);
store_unsigned_integer
- (buf, register_size (current_gdbarch,
- gdbarch_pc_regnum (current_gdbarch)), rfp);
+ (buf, register_size (gdbarch, gdbarch_pc_regnum (gdbarch)), rfp);
regcache_raw_supply (regcache, 30, buf); /* This register they are avoiding and so it is unnamed */
- store_unsigned_integer (buf, register_size (current_gdbarch,
- gdbarch_sp_regnum (current_gdbarch)), rsp);
- regcache_raw_supply (regcache, gdbarch_sp_regnum (current_gdbarch), buf);
+ store_unsigned_integer (buf, register_size (gdbarch,
+ gdbarch_sp_regnum (gdbarch)), rsp);
+ regcache_raw_supply (regcache, gdbarch_sp_regnum (gdbarch), buf);
store_unsigned_integer (buf,
- register_size (current_gdbarch,
+ register_size (gdbarch,
gdbarch_deprecated_fp_regnum
- (current_gdbarch)),
+ (gdbarch)),
0);
regcache_raw_supply (regcache,
- gdbarch_deprecated_fp_regnum (current_gdbarch), buf);
+ gdbarch_deprecated_fp_regnum (gdbarch), buf);
if (nfields == 9)
{
@@ -1904,17 +1903,18 @@ mips_map_regno (int regno)
static void
mips_fetch_registers (struct regcache *regcache, int regno)
{
+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
unsigned LONGEST val;
int err;
if (regno == -1)
{
- for (regno = 0; regno < gdbarch_num_regs (current_gdbarch); regno++)
+ for (regno = 0; regno < gdbarch_num_regs (gdbarch); regno++)
mips_fetch_registers (regcache, regno);
return;
}
- if (regno == gdbarch_deprecated_fp_regnum (current_gdbarch)
+ if (regno == gdbarch_deprecated_fp_regnum (gdbarch)
|| regno == MIPS_ZERO_REGNUM)
/* gdbarch_deprecated_fp_regnum on the mips is a hack which is just
supposed to read zero (see also mips-nat.c). */
@@ -1948,7 +1948,7 @@ mips_fetch_registers (struct regcache *regcache, int regno)
/* We got the number the register holds, but gdb expects to see a
value in the target byte ordering. */
- store_unsigned_integer (buf, register_size (current_gdbarch, regno), val);
+ store_unsigned_integer (buf, register_size (gdbarch, regno), val);
regcache_raw_supply (regcache, regno, buf);
}
}
@@ -1966,12 +1966,13 @@ mips_prepare_to_store (struct regcache *regcache)
static void
mips_store_registers (struct regcache *regcache, int regno)
{
+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
ULONGEST val;
int err;
if (regno == -1)
{
- for (regno = 0; regno < gdbarch_num_regs (current_gdbarch); regno++)
+ for (regno = 0; regno < gdbarch_num_regs (gdbarch); regno++)
mips_store_registers (regcache, regno);
return;
}