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.
This commit is contained in:
Markus Deuling 2007-11-16 04:56:45 +00:00
parent 40a6adc1f8
commit 64a3914f1d
10 changed files with 52 additions and 32 deletions

View File

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

View File

@ -77,17 +77,17 @@ alpha_register_name (struct gdbarch *gdbarch, int regno)
}
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 *

View File

@ -125,7 +125,7 @@ default_coff_make_msymbol_special (int val, struct minimal_symbol *msym)
}
int
cannot_register_not (int regnum)
cannot_register_not (struct gdbarch *gdbarch, int regnum)
{
return 0;
}

View File

@ -54,7 +54,7 @@ void default_coff_make_msymbol_special (int val, struct minimal_symbol *msym);
/* 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

View File

@ -1590,9 +1590,9 @@ cris_register_size (int regno)
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));
}
@ -1600,7 +1600,7 @@ cris_cannot_fetch_register (int regno)
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.
@ -1609,7 +1609,7 @@ cris_cannot_store_register (int regno)
*/
if (regno < 0
|| regno >= gdbarch_num_regs (current_gdbarch)
|| regno >= gdbarch_num_regs (gdbarch)
|| cris_register_size (regno) == 0)
/* Not implemented. */
return 1;
@ -1632,9 +1632,9 @@ cris_cannot_store_register (int regno)
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));
}
@ -1642,7 +1642,7 @@ crisv32_cannot_fetch_register (int regno)
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.
@ -1651,7 +1651,7 @@ crisv32_cannot_store_register (int regno)
*/
if (regno < 0
|| regno >= gdbarch_num_regs (current_gdbarch)
|| regno >= gdbarch_num_regs (gdbarch)
|| cris_register_size (regno) == 0)
/* Not implemented. */
return 1;

View File

@ -291,8 +291,8 @@ struct gdbarch startup_gdbarch =
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 */
@ -1830,7 +1830,7 @@ gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
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
@ -1847,7 +1847,7 @@ gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
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

View File

@ -300,11 +300,11 @@ typedef int (gdbarch_register_sim_regno_ftype) (int reg_nr);
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);

View File

@ -445,8 +445,8 @@ M:void:print_vector_info:struct ui_file *file, struct frame_info *frame, const c
# 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
#

View File

@ -2632,7 +2632,7 @@ hppa64_register_type (struct gdbarch *gdbarch, int regnum)
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
@ -2641,17 +2641,17 @@ hppa32_cannot_store_register (int 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
@ -2660,13 +2660,13 @@ hppa64_cannot_store_register (int 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

View File

@ -309,17 +309,17 @@ mipsnbsd_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
}
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. */