diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2007-10-08 12:51:54 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2007-10-08 12:51:54 +0000 |
commit | 088568da7d2e32bd0919a62766c2bf21f320961e (patch) | |
tree | c3f5c6c9d88349a86b9efb99cba1d5c30a853bcd /gdb/ia64-linux-nat.c | |
parent | 464963c92cc07668165c0e503994b41cde3daa4b (diff) | |
download | gdb-088568da7d2e32bd0919a62766c2bf21f320961e.zip gdb-088568da7d2e32bd0919a62766c2bf21f320961e.tar.gz gdb-088568da7d2e32bd0919a62766c2bf21f320961e.tar.bz2 |
2007-10-08 Markus Deuling <deuling@de.ibm.com>
* ia64-tdep.c (ia64_pseudo_register_read, ia64_pseudo_register_write):
Replace current_gdbarch by gdbarch.
* ia64-tdep.c (ia64_frame_prev_register
(ia64_sigtramp_frame_prev_register)
(ia64_libunwind_frame_prev_register): Use get_regcache_arch or
get_frame_arch to get at the current architecture by regcache or by
frame, respectively.
* ia64-linux-nat.c (ia64_linux_fetch_register)
(ia64_linux_fetch_registers, ia64_linux_store_register)
(ia64_linux_store_registers): Likewise.
Diffstat (limited to 'gdb/ia64-linux-nat.c')
-rw-r--r-- | gdb/ia64-linux-nat.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c index fb29d8c..e4f1f7d 100644 --- a/gdb/ia64-linux-nat.c +++ b/gdb/ia64-linux-nat.c @@ -674,6 +674,7 @@ ia64_linux_can_use_hw_breakpoint (int type, int cnt, int othertype) static void ia64_linux_fetch_register (struct regcache *regcache, int regnum) { + struct gdbarch *gdbarch = get_regcache_arch (regcache); CORE_ADDR addr; size_t size; PTRACE_TYPE_RET *buf; @@ -693,7 +694,7 @@ ia64_linux_fetch_register (struct regcache *regcache, int regnum) /* This isn't really an address, but ptrace thinks of it as one. */ addr = ia64_register_addr (regnum); - size = register_size (current_gdbarch, regnum); + size = register_size (gdbarch, regnum); gdb_assert ((size % sizeof (PTRACE_TYPE_RET)) == 0); buf = alloca (size); @@ -705,7 +706,7 @@ ia64_linux_fetch_register (struct regcache *regcache, int regnum) buf[i] = ptrace (PT_READ_U, pid, (PTRACE_TYPE_ARG3)addr, 0); if (errno != 0) error (_("Couldn't read register %s (#%d): %s."), - gdbarch_register_name (current_gdbarch, regnum), + gdbarch_register_name (gdbarch, regnum), regnum, safe_strerror (errno)); addr += sizeof (PTRACE_TYPE_RET); @@ -720,7 +721,9 @@ static void ia64_linux_fetch_registers (struct regcache *regcache, int regnum) { if (regnum == -1) - for (regnum = 0; regnum < gdbarch_num_regs (current_gdbarch); regnum++) + for (regnum = 0; + regnum < gdbarch_num_regs (get_regcache_arch (regcache)); + regnum++) ia64_linux_fetch_register (regcache, regnum); else ia64_linux_fetch_register (regcache, regnum); @@ -731,6 +734,7 @@ ia64_linux_fetch_registers (struct regcache *regcache, int regnum) static void ia64_linux_store_register (const struct regcache *regcache, int regnum) { + struct gdbarch *gdbarch = get_regcache_arch (regcache); CORE_ADDR addr; size_t size; PTRACE_TYPE_RET *buf; @@ -747,7 +751,7 @@ ia64_linux_store_register (const struct regcache *regcache, int regnum) /* This isn't really an address, but ptrace thinks of it as one. */ addr = ia64_register_addr (regnum); - size = register_size (current_gdbarch, regnum); + size = register_size (gdbarch, regnum); gdb_assert ((size % sizeof (PTRACE_TYPE_RET)) == 0); buf = alloca (size); @@ -760,7 +764,7 @@ ia64_linux_store_register (const struct regcache *regcache, int regnum) ptrace (PT_WRITE_U, pid, (PTRACE_TYPE_ARG3)addr, buf[i]); if (errno != 0) error (_("Couldn't write register %s (#%d): %s."), - gdbarch_register_name (current_gdbarch, regnum), + gdbarch_register_name (gdbarch, regnum), regnum, safe_strerror (errno)); addr += sizeof (PTRACE_TYPE_RET); @@ -774,7 +778,9 @@ static void ia64_linux_store_registers (struct regcache *regcache, int regnum) { if (regnum == -1) - for (regnum = 0; regnum < gdbarch_num_regs (current_gdbarch); regnum++) + for (regnum = 0; + regnum < gdbarch_num_regs (get_regcache_arch (regcache)); + regnum++) ia64_linux_store_register (regcache, regnum); else ia64_linux_store_register (regcache, regnum); |