+2007-11-16 Markus Deuling <deuling@de.ibm.com>
+
+ * gdbarch.sh (cannot_fetch_register, cannot_store_register): Add gdbarch
+ as parameter.
+ * gdbarch.{c,h}: Regenerate.
+
+ * alpha-tdep.c (alpha_cannot_fetch_register)
+ (alpha_cannot_store_register): Add gdbarch as parameter. Replace
+ current_gdbarch by gdbarch.
+ * cris-tdep.c (cris_cannot_fetch_register, cris_cannot_store_register)
+ (crisv32_cannot_fetch_register)
+ (crisv32_cannot_store_register): Likewise.
+ * arch-utils.c (cannot_register_not): Likewise.
+ * arch-utils.h (cannot_register_not): Likewise.
+ * hppa-tdep.c (hppa32_cannot_store_register)
+ (hppa32_cannot_store_register, hppa64_cannot_store_register)
+ (hppa64_cannot_fetch_register): Likewise.
+ * mipsnbsd-tdep.c (mipsnbsd_cannot_fetch_register)
+ (mipsnbsd_cannot_store_register): Likewise.
+
2007-11-16 Markus Deuling <deuling@de.ibm.com>
* m32r-rom.c (m32r_supply_register): Use get_regcache_arch to get at
}
static int
-alpha_cannot_fetch_register (int regno)
+alpha_cannot_fetch_register (struct gdbarch *gdbarch, int regno)
{
return (regno == ALPHA_ZERO_REGNUM
- || strlen (alpha_register_name (current_gdbarch, regno)) == 0);
+ || strlen (alpha_register_name (gdbarch, regno)) == 0);
}
static int
-alpha_cannot_store_register (int regno)
+alpha_cannot_store_register (struct gdbarch *gdbarch, int regno)
{
return (regno == ALPHA_ZERO_REGNUM
- || strlen (alpha_register_name (current_gdbarch, regno)) == 0);
+ || strlen (alpha_register_name (gdbarch, regno)) == 0);
}
static struct type *
}
int
-cannot_register_not (int regnum)
+cannot_register_not (struct gdbarch *gdbarch, int regnum)
{
return 0;
}
/* Version of cannot_fetch_register() / cannot_store_register() that
always fails. */
-int cannot_register_not (int regnum);
+int cannot_register_not (struct gdbarch *gdbarch, int regnum);
/* Legacy version of target_virtual_frame_pointer(). Assumes that
there is an gdbarch_deprecated_fp_regnum and that it is the same, cooked or
for unimplemented (size 0) and non-existant registers. */
static int
-cris_cannot_fetch_register (int regno)
+cris_cannot_fetch_register (struct gdbarch *gdbarch, int regno)
{
- return ((regno < 0 || regno >= gdbarch_num_regs (current_gdbarch))
+ return ((regno < 0 || regno >= gdbarch_num_regs (gdbarch))
|| (cris_register_size (regno) == 0));
}
reasons. */
static int
-cris_cannot_store_register (int regno)
+cris_cannot_store_register (struct gdbarch *gdbarch, int regno)
{
/* There are three kinds of registers we refuse to write to.
1. Those that not implemented.
*/
if (regno < 0
- || regno >= gdbarch_num_regs (current_gdbarch)
+ || regno >= gdbarch_num_regs (gdbarch)
|| cris_register_size (regno) == 0)
/* Not implemented. */
return 1;
for unimplemented (size 0) and non-existant registers. */
static int
-crisv32_cannot_fetch_register (int regno)
+crisv32_cannot_fetch_register (struct gdbarch *gdbarch, int regno)
{
- return ((regno < 0 || regno >= gdbarch_num_regs (current_gdbarch))
+ return ((regno < 0 || regno >= gdbarch_num_regs (gdbarch))
|| (cris_register_size (regno) == 0));
}
reasons. */
static int
-crisv32_cannot_store_register (int regno)
+crisv32_cannot_store_register (struct gdbarch *gdbarch, int regno)
{
/* There are three kinds of registers we refuse to write to.
1. Those that not implemented.
*/
if (regno < 0
- || regno >= gdbarch_num_regs (current_gdbarch)
+ || regno >= gdbarch_num_regs (gdbarch)
|| cris_register_size (regno) == 0)
/* Not implemented. */
return 1;
0, /* print_float_info */
0, /* print_vector_info */
0, /* register_sim_regno */
- 0, /* cannot_fetch_register */
- 0, /* cannot_store_register */
+ cannot_register_not, /* cannot_fetch_register */
+ cannot_register_not, /* cannot_store_register */
0, /* get_longjmp_target */
0, /* believe_pcc_promotion */
generic_convert_register_p, /* convert_register_p */
gdb_assert (gdbarch->cannot_fetch_register != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
- return gdbarch->cannot_fetch_register (regnum);
+ return gdbarch->cannot_fetch_register (gdbarch, regnum);
}
void
gdb_assert (gdbarch->cannot_store_register != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
- return gdbarch->cannot_store_register (regnum);
+ return gdbarch->cannot_store_register (gdbarch, regnum);
}
void
extern int gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr);
extern void set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, gdbarch_register_sim_regno_ftype *register_sim_regno);
-typedef int (gdbarch_cannot_fetch_register_ftype) (int regnum);
+typedef int (gdbarch_cannot_fetch_register_ftype) (struct gdbarch *gdbarch, int regnum);
extern int gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum);
extern void set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, gdbarch_cannot_fetch_register_ftype *cannot_fetch_register);
-typedef int (gdbarch_cannot_store_register_ftype) (int regnum);
+typedef int (gdbarch_cannot_store_register_ftype) (struct gdbarch *gdbarch, int regnum);
extern int gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum);
extern void set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, gdbarch_cannot_store_register_ftype *cannot_store_register);
# MAP a GDB RAW register number onto a simulator register number. See
# also include/...-sim.h.
f:int:register_sim_regno:int reg_nr:reg_nr::legacy_register_sim_regno::0
-f:int:cannot_fetch_register:int regnum:regnum::cannot_register_not::0
-f:int:cannot_store_register:int regnum:regnum::cannot_register_not::0
+m:int:cannot_fetch_register:int regnum:regnum::cannot_register_not::0
+m:int:cannot_store_register:int regnum:regnum::cannot_register_not::0
# setjmp/longjmp support.
F:int:get_longjmp_target:struct frame_info *frame, CORE_ADDR *pc:frame, pc
#
through ptrace/ttrace. */
static int
-hppa32_cannot_store_register (int regnum)
+hppa32_cannot_store_register (struct gdbarch *gdbarch, int regnum)
{
return (regnum == 0
|| regnum == HPPA_PCSQ_HEAD_REGNUM
}
static int
-hppa32_cannot_fetch_register (int regnum)
+hppa32_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
{
/* cr26 and cr27 are readable (but not writable) from userspace. */
if (regnum == HPPA_CR26_REGNUM || regnum == HPPA_CR27_REGNUM)
return 0;
else
- return hppa32_cannot_store_register (regnum);
+ return hppa32_cannot_store_register (gdbarch, regnum);
}
static int
-hppa64_cannot_store_register (int regnum)
+hppa64_cannot_store_register (struct gdbarch *gdbarch, int regnum)
{
return (regnum == 0
|| regnum == HPPA_PCSQ_HEAD_REGNUM
}
static int
-hppa64_cannot_fetch_register (int regnum)
+hppa64_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
{
/* cr26 and cr27 are readable (but not writable) from userspace. */
if (regnum == HPPA_CR26_REGNUM || regnum == HPPA_CR27_REGNUM)
return 0;
else
- return hppa64_cannot_store_register (regnum);
+ return hppa64_cannot_store_register (gdbarch, regnum);
}
static CORE_ADDR
}
static int
-mipsnbsd_cannot_fetch_register (int regno)
+mipsnbsd_cannot_fetch_register (struct gdbarch *gdbarch, int regno)
{
return (regno == MIPS_ZERO_REGNUM
- || regno == mips_regnum (current_gdbarch)->fp_implementation_revision);
+ || regno == mips_regnum (gdbarch)->fp_implementation_revision);
}
static int
-mipsnbsd_cannot_store_register (int regno)
+mipsnbsd_cannot_store_register (struct gdbarch *gdbarch, int regno)
{
return (regno == MIPS_ZERO_REGNUM
- || regno == mips_regnum (current_gdbarch)->fp_implementation_revision);
+ || regno == mips_regnum (gdbarch)->fp_implementation_revision);
}
/* Shared library support. */