+2007-10-12 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * ia64-linux-nat.c (ia64_register_addr): Add gdbarch parameter,
+ replacing use of global current_gdbarch.
+ (ia64_cannot_fetch_register, ia64_cannot_store_register): Likewise.
+ (ia64_linux_fetch_register, ia64_linux_store_register): Update callers.
+
+ * ia64-tdep.c (SIGCONTEXT_REGISTER_ADDRESS): Remove macro.
+ (ia64_sigtramp_frame_init_saved_regs): Add next_frame parameter,
+ replace uses of SIGCONTEXT_REGISTER_ADDRESS.
+ (ia64_sigtramp_frame_cache): Update caller.
+
2007-10-12 Ulrich Weigand <uweigand@de.ibm.com>
* gdbarch.sh (deprecated_use_struct_convention): Remove.
};
static CORE_ADDR
-ia64_register_addr (int regno)
+ia64_register_addr (struct gdbarch *gdbarch, int regno)
{
CORE_ADDR addr;
- if (regno < 0 || regno >= gdbarch_num_regs (current_gdbarch))
+ if (regno < 0 || regno >= gdbarch_num_regs (gdbarch))
error (_("Invalid register number %d."), regno);
if (u_offsets[regno] == -1)
}
static int
-ia64_cannot_fetch_register (int regno)
+ia64_cannot_fetch_register (struct gdbarch *gdbarch, int regno)
{
return regno < 0
- || regno >= gdbarch_num_regs (current_gdbarch)
+ || regno >= gdbarch_num_regs (gdbarch)
|| u_offsets[regno] == -1;
}
static int
-ia64_cannot_store_register (int regno)
+ia64_cannot_store_register (struct gdbarch *gdbarch, int regno)
{
/* Rationale behind not permitting stores to bspstore...
back.) */
return regno < 0
- || regno >= gdbarch_num_regs (current_gdbarch)
+ || regno >= gdbarch_num_regs (gdbarch)
|| u_offsets[regno] == -1
|| regno == IA64_BSPSTORE_REGNUM;
}
PTRACE_TYPE_RET *buf;
int pid, i;
- if (ia64_cannot_fetch_register (regnum))
+ if (ia64_cannot_fetch_register (gdbarch, regnum))
{
regcache_raw_supply (regcache, regnum, NULL);
return;
pid = ptid_get_pid (inferior_ptid);
/* This isn't really an address, but ptrace thinks of it as one. */
- addr = ia64_register_addr (regnum);
+ addr = ia64_register_addr (gdbarch, regnum);
size = register_size (gdbarch, regnum);
gdb_assert ((size % sizeof (PTRACE_TYPE_RET)) == 0);
PTRACE_TYPE_RET *buf;
int pid, i;
- if (ia64_cannot_store_register (regnum))
+ if (ia64_cannot_store_register (gdbarch, regnum))
return;
/* Cater for systems like GNU/Linux, that implement threads as
pid = ptid_get_pid (inferior_ptid);
/* This isn't really an address, but ptrace thinks of it as one. */
- addr = ia64_register_addr (regnum);
+ addr = ia64_register_addr (gdbarch, regnum);
size = register_size (gdbarch, regnum);
gdb_assert ((size % sizeof (PTRACE_TYPE_RET)) == 0);
};
-#define SIGCONTEXT_REGISTER_ADDRESS \
- (gdbarch_tdep (current_gdbarch)->sigcontext_register_address)
-
int
ia64_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
struct reggroup *group)
/* Signal trampolines. */
static void
-ia64_sigtramp_frame_init_saved_regs (struct ia64_frame_cache *cache)
+ia64_sigtramp_frame_init_saved_regs (struct frame_info *next_frame,
+ struct ia64_frame_cache *cache)
{
- if (SIGCONTEXT_REGISTER_ADDRESS)
+ struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (next_frame));
+
+ if (tdep->sigcontext_register_address)
{
int regno;
cache->saved_regs[IA64_VRAP_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (cache->base, IA64_IP_REGNUM);
+ tdep->sigcontext_register_address (cache->base, IA64_IP_REGNUM);
cache->saved_regs[IA64_CFM_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (cache->base, IA64_CFM_REGNUM);
+ tdep->sigcontext_register_address (cache->base, IA64_CFM_REGNUM);
cache->saved_regs[IA64_PSR_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (cache->base, IA64_PSR_REGNUM);
+ tdep->sigcontext_register_address (cache->base, IA64_PSR_REGNUM);
cache->saved_regs[IA64_BSP_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (cache->base, IA64_BSP_REGNUM);
+ tdep->sigcontext_register_address (cache->base, IA64_BSP_REGNUM);
cache->saved_regs[IA64_RNAT_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (cache->base, IA64_RNAT_REGNUM);
+ tdep->sigcontext_register_address (cache->base, IA64_RNAT_REGNUM);
cache->saved_regs[IA64_CCV_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (cache->base, IA64_CCV_REGNUM);
+ tdep->sigcontext_register_address (cache->base, IA64_CCV_REGNUM);
cache->saved_regs[IA64_UNAT_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (cache->base, IA64_UNAT_REGNUM);
+ tdep->sigcontext_register_address (cache->base, IA64_UNAT_REGNUM);
cache->saved_regs[IA64_FPSR_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (cache->base, IA64_FPSR_REGNUM);
+ tdep->sigcontext_register_address (cache->base, IA64_FPSR_REGNUM);
cache->saved_regs[IA64_PFS_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (cache->base, IA64_PFS_REGNUM);
+ tdep->sigcontext_register_address (cache->base, IA64_PFS_REGNUM);
cache->saved_regs[IA64_LC_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (cache->base, IA64_LC_REGNUM);
+ tdep->sigcontext_register_address (cache->base, IA64_LC_REGNUM);
for (regno = IA64_GR1_REGNUM; regno <= IA64_GR31_REGNUM; regno++)
cache->saved_regs[regno] =
- SIGCONTEXT_REGISTER_ADDRESS (cache->base, regno);
+ tdep->sigcontext_register_address (cache->base, regno);
for (regno = IA64_BR0_REGNUM; regno <= IA64_BR7_REGNUM; regno++)
cache->saved_regs[regno] =
- SIGCONTEXT_REGISTER_ADDRESS (cache->base, regno);
+ tdep->sigcontext_register_address (cache->base, regno);
for (regno = IA64_FR2_REGNUM; regno <= IA64_FR31_REGNUM; regno++)
cache->saved_regs[regno] =
- SIGCONTEXT_REGISTER_ADDRESS (cache->base, regno);
+ tdep->sigcontext_register_address (cache->base, regno);
}
}
cache->cfm = extract_unsigned_integer (buf, 8);
cache->sof = cache->cfm & 0x7f;
- ia64_sigtramp_frame_init_saved_regs (cache);
+ ia64_sigtramp_frame_init_saved_regs (next_frame, cache);
*this_cache = cache;
return cache;