mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-29 02:20:51 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user