* 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.
This commit is contained in:
Ulrich Weigand 2007-10-13 00:49:15 +00:00
parent e041f13d5a
commit 2685572f6e
3 changed files with 41 additions and 29 deletions

View file

@ -1,3 +1,15 @@
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.

View file

@ -302,11 +302,11 @@ static int u_offsets[] =
};
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)
@ -318,15 +318,15 @@ ia64_register_addr (int regno)
}
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...
@ -358,7 +358,7 @@ ia64_cannot_store_register (int regno)
back.) */
return regno < 0
|| regno >= gdbarch_num_regs (current_gdbarch)
|| regno >= gdbarch_num_regs (gdbarch)
|| u_offsets[regno] == -1
|| regno == IA64_BSPSTORE_REGNUM;
}
@ -680,7 +680,7 @@ ia64_linux_fetch_register (struct regcache *regcache, int 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;
@ -693,7 +693,7 @@ ia64_linux_fetch_register (struct regcache *regcache, int regnum)
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);
@ -740,7 +740,7 @@ ia64_linux_store_register (const struct regcache *regcache, int regnum)
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
@ -750,7 +750,7 @@ ia64_linux_store_register (const struct regcache *regcache, int regnum)
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);

View file

@ -274,9 +274,6 @@ struct ia64_frame_cache
};
#define SIGCONTEXT_REGISTER_ADDRESS \
(gdbarch_tdep (current_gdbarch)->sigcontext_register_address)
int
ia64_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
struct reggroup *group)
@ -1909,41 +1906,44 @@ ia64_frame_sniffer (struct frame_info *next_frame)
/* 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);
}
}
@ -1972,7 +1972,7 @@ ia64_sigtramp_frame_cache (struct frame_info *next_frame, void **this_cache)
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;