summaryrefslogtreecommitdiff
path: root/gdb/ia64-linux-nat.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2007-10-08 12:51:54 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2007-10-08 12:51:54 +0000
commit164f0f2691fa31981e08b6cff7f84e16cf417621 (patch)
tree7f8a4c3810e6ff2d9f34261fc7f0902e9125cf96 /gdb/ia64-linux-nat.c
parentdfdaad29bea1b40e14f3220860ddd86ac7bd9fd2 (diff)
downloadgdb-164f0f2691fa31981e08b6cff7f84e16cf417621.tar.gz
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.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c
index fb29d8c8373..e4f1f7d3bdb 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);