diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2007-10-08 12:50:56 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2007-10-08 12:50:56 +0000 |
commit | 464963c92cc07668165c0e503994b41cde3daa4b (patch) | |
tree | c0ca0d91497447cff4919e9eb982ee2d6bf8e5c4 /gdb/hppa-linux-nat.c | |
parent | 7fbe2eba67086bb413f4187d3dedc8fb3457ac3e (diff) | |
download | gdb-464963c92cc07668165c0e503994b41cde3daa4b.zip gdb-464963c92cc07668165c0e503994b41cde3daa4b.tar.gz gdb-464963c92cc07668165c0e503994b41cde3daa4b.tar.bz2 |
2007-10-08 Markus Deuling <deuling@de.ibm.com>
* hppa-tdep.c (hppa_stub_unwind_sniffer, hppa_dump_tdep): Replace
current_gdbarch by gdbarch.
* hppa-linux-nat.c (fetch_register, store_register)
(hppa_linux_fetch_inferior_registers)
(hppa_linux_store_inferior_registers): Use get_regcache_arch or
get_frame_arch to get at the current architecture by regcache or by
frame, respectively.
* hppa-hpux-tdep.c (hppa_hpux_skip_trampoline_code
(hppa_hpux_unwind_adjust_stub): Likewise.
* hppa-hpux-nat.c (hppa_hpux_fetch_register, hppa_hpux_store_register)
(hppa_hpux_fetch_inferior_registers)
(hppa_hpux_store_inferior_registers): Likewise.
Diffstat (limited to 'gdb/hppa-linux-nat.c')
-rw-r--r-- | gdb/hppa-linux-nat.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/gdb/hppa-linux-nat.c b/gdb/hppa-linux-nat.c index 87db5a4..def0f86 100644 --- a/gdb/hppa-linux-nat.c +++ b/gdb/hppa-linux-nat.c @@ -216,10 +216,11 @@ static const int greg_map[] = static void fetch_register (struct regcache *regcache, int regno) { + struct gdbarch *gdbarch = get_regcache_arch (regcache); int tid; int val; - if (gdbarch_cannot_fetch_register (current_gdbarch, regno)) + if (gdbarch_cannot_fetch_register (gdbarch, regno)) { regcache_raw_supply (regcache, regno, NULL); return; @@ -234,7 +235,7 @@ fetch_register (struct regcache *regcache, int regno) val = ptrace (PTRACE_PEEKUSER, tid, hppa_linux_register_addr (regno, 0), 0); if (errno != 0) error (_("Couldn't read register %s (#%d): %s."), - gdbarch_register_name (current_gdbarch, regno), + gdbarch_register_name (gdbarch, regno), regno, safe_strerror (errno)); regcache_raw_supply (regcache, regno, &val); @@ -245,10 +246,11 @@ fetch_register (struct regcache *regcache, int regno) static void store_register (const struct regcache *regcache, int regno) { + struct gdbarch *gdbarch = get_regcache_arch (regcache); int tid; int val; - if (gdbarch_cannot_store_register (current_gdbarch, regno)) + if (gdbarch_cannot_store_register (gdbarch, regno)) return; /* GNU/Linux LWP ID's are process ID's. */ @@ -261,7 +263,7 @@ store_register (const struct regcache *regcache, int regno) ptrace (PTRACE_POKEUSER, tid, hppa_linux_register_addr (regno, 0), val); if (errno != 0) error (_("Couldn't write register %s (#%d): %s."), - gdbarch_register_name (current_gdbarch, regno), + gdbarch_register_name (gdbarch, regno), regno, safe_strerror (errno)); } @@ -274,7 +276,9 @@ hppa_linux_fetch_inferior_registers (struct regcache *regcache, int regno) { if (-1 == regno) { - for (regno = 0; regno < gdbarch_num_regs (current_gdbarch); regno++) + for (regno = 0; + regno < gdbarch_num_regs (get_regcache_arch (regcache)); + regno++) fetch_register (regcache, regno); } else @@ -292,7 +296,9 @@ hppa_linux_store_inferior_registers (struct regcache *regcache, int regno) { if (-1 == regno) { - for (regno = 0; regno < gdbarch_num_regs (current_gdbarch); regno++) + for (regno = 0; + regno < gdbarch_num_regs (get_regcache_arch (regcache)); + regno++) store_register (regcache, regno); } else |