diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2007-10-10 17:04:38 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2007-10-10 17:04:38 +0000 |
commit | 2eb4d78bfd092cb2cf360e679bf8dcd7d212764a (patch) | |
tree | 288fb4bc4ece2130f6baddc2e400c95a174b8c2b /gdb/mipsnbsd-tdep.c | |
parent | 72a155b44d8601da263e2d4be0fe107a4d1e7f23 (diff) | |
download | gdb-2eb4d78bfd092cb2cf360e679bf8dcd7d212764a.zip gdb-2eb4d78bfd092cb2cf360e679bf8dcd7d212764a.tar.gz gdb-2eb4d78bfd092cb2cf360e679bf8dcd7d212764a.tar.bz2 |
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/mipsnbsd-tdep.c')
-rw-r--r-- | gdb/mipsnbsd-tdep.c | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/gdb/mipsnbsd-tdep.c b/gdb/mipsnbsd-tdep.c index 05518cf..f4805a6 100644 --- a/gdb/mipsnbsd-tdep.c +++ b/gdb/mipsnbsd-tdep.c @@ -142,17 +142,18 @@ mipsnbsd_regset_from_core_section (struct gdbarch *gdbarch, void mipsnbsd_supply_reg (struct regcache *regcache, const char *regs, int regno) { + struct gdbarch *gdbarch = get_regcache_arch (regcache); int i; - for (i = 0; i <= gdbarch_pc_regnum (current_gdbarch); i++) + for (i = 0; i <= gdbarch_pc_regnum (gdbarch); i++) { if (regno == i || regno == -1) { - if (gdbarch_cannot_fetch_register (current_gdbarch, i)) + if (gdbarch_cannot_fetch_register (gdbarch, i)) regcache_raw_supply (regcache, i, NULL); else regcache_raw_supply (regcache, i, - regs + (i * mips_isa_regsize (current_gdbarch))); + regs + (i * mips_isa_regsize (gdbarch))); } } } @@ -160,33 +161,35 @@ mipsnbsd_supply_reg (struct regcache *regcache, const char *regs, int regno) void mipsnbsd_fill_reg (const struct regcache *regcache, char *regs, int regno) { + struct gdbarch *gdbarch = get_regcache_arch (regcache); int i; - for (i = 0; i <= gdbarch_pc_regnum (current_gdbarch); i++) + for (i = 0; i <= gdbarch_pc_regnum (gdbarch); i++) if ((regno == i || regno == -1) - && ! gdbarch_cannot_store_register (current_gdbarch, i)) + && ! gdbarch_cannot_store_register (gdbarch, i)) regcache_raw_collect (regcache, i, - regs + (i * mips_isa_regsize (current_gdbarch))); + regs + (i * mips_isa_regsize (gdbarch))); } void mipsnbsd_supply_fpreg (struct regcache *regcache, const char *fpregs, int regno) { + struct gdbarch *gdbarch = get_regcache_arch (regcache); int i; - for (i = gdbarch_fp0_regnum (current_gdbarch); - i <= mips_regnum (current_gdbarch)->fp_implementation_revision; + for (i = gdbarch_fp0_regnum (gdbarch); + i <= mips_regnum (gdbarch)->fp_implementation_revision; i++) { if (regno == i || regno == -1) { - if (gdbarch_cannot_fetch_register (current_gdbarch, i)) + if (gdbarch_cannot_fetch_register (gdbarch, i)) regcache_raw_supply (regcache, i, NULL); else regcache_raw_supply (regcache, i, fpregs - + ((i - gdbarch_fp0_regnum (current_gdbarch)) - * mips_isa_regsize (current_gdbarch))); + + ((i - gdbarch_fp0_regnum (gdbarch)) + * mips_isa_regsize (gdbarch))); } } } @@ -194,17 +197,17 @@ mipsnbsd_supply_fpreg (struct regcache *regcache, const char *fpregs, int regno) void mipsnbsd_fill_fpreg (const struct regcache *regcache, char *fpregs, int regno) { + struct gdbarch *gdbarch = get_regcache_arch (regcache); int i; - for (i = gdbarch_fp0_regnum (current_gdbarch); - i <= mips_regnum (current_gdbarch)->fp_control_status; + for (i = gdbarch_fp0_regnum (gdbarch); + i <= mips_regnum (gdbarch)->fp_control_status; i++) if ((regno == i || regno == -1) - && ! gdbarch_cannot_store_register (current_gdbarch, i)) + && ! gdbarch_cannot_store_register (gdbarch, i)) regcache_raw_collect (regcache, i, - fpregs + ((i - gdbarch_fp0_regnum - (current_gdbarch)) - * mips_isa_regsize (current_gdbarch))); + fpregs + ((i - gdbarch_fp0_regnum (gdbarch)) + * mips_isa_regsize (gdbarch))); } /* Under NetBSD/mips, signal handler invocations can be identified by the @@ -244,7 +247,7 @@ static LONGEST mipsnbsd_sigtramp_offset (struct frame_info *next_frame) { CORE_ADDR pc = frame_pc_unwind (next_frame); - const char *retcode = gdbarch_byte_order (current_gdbarch) + const char *retcode = gdbarch_byte_order (get_frame_arch (next_frame)) == BFD_ENDIAN_BIG ? sigtramp_retcode_mipseb : sigtramp_retcode_mipsel; unsigned char ret[RETCODE_SIZE], w[4]; |