2007-05-31 Markus Deuling <deuling@de.ibm.com>

* gdbarch.sh (CANNOT_FETCH_REGISTER): Replace by
	gdbarch_cannot_fetch_register.
	* alpha-nat.c (fetch_osf_core_registers): Likewise.
	* hppa-linux-nat.c (fetch_register): Likewise.
	* inf-ptrace.c (inf_ptrace_fetch_register): Likewise.
	* m68klinux-nat.c (fetch_register): Likewise.
	* mipsnbsd-tdep.c (mipsnbsd_supply_reg, mipsnbsd_supply_fpreg):
	Likewise.
	* gdbarch.sh (CANNOT_STORE_REGISTER): Replace by
	gdbarch_cannot_store_register.
	* hppa-linux-nat.c (store_register): Likewise.
	* inf-ptrace.c (inf_ptrace_store_register): Likewise.
	* regcache.c (regcache_raw_write): Likewise.
	* m68klinux-nat.c (store_register): Likewise.
	* mipsnbsd-tdep.c (mipsnbsd_fill_reg, mipsnbsd_fill_fpreg): Likewise.
	* gdbarch.c, gdbarch.h: Regenerate.
This commit is contained in:
Ulrich Weigand 2007-05-31 17:19:32 +00:00
parent 3f4844da1d
commit 8d4c1ba398
10 changed files with 38 additions and 41 deletions

View file

@ -1,3 +1,22 @@
2007-05-31 Markus Deuling <deuling@de.ibm.com>
* gdbarch.sh (CANNOT_FETCH_REGISTER): Replace by
gdbarch_cannot_fetch_register.
* alpha-nat.c (fetch_osf_core_registers): Likewise.
* hppa-linux-nat.c (fetch_register): Likewise.
* inf-ptrace.c (inf_ptrace_fetch_register): Likewise.
* m68klinux-nat.c (fetch_register): Likewise.
* mipsnbsd-tdep.c (mipsnbsd_supply_reg, mipsnbsd_supply_fpreg):
Likewise.
* gdbarch.sh (CANNOT_STORE_REGISTER): Replace by
gdbarch_cannot_store_register.
* hppa-linux-nat.c (store_register): Likewise.
* inf-ptrace.c (inf_ptrace_store_register): Likewise.
* regcache.c (regcache_raw_write): Likewise.
* m68klinux-nat.c (store_register): Likewise.
* mipsnbsd-tdep.c (mipsnbsd_fill_reg, mipsnbsd_fill_fpreg): Likewise.
* gdbarch.c, gdbarch.h: Regenerate.
2007-05-31 Markus Deuling <deuling@de.ibm.com> 2007-05-31 Markus Deuling <deuling@de.ibm.com>
* gdbarch.sh (TARGET_OSABI): Replace by gdbarch_osabi. * gdbarch.sh (TARGET_OSABI): Replace by gdbarch_osabi.

View file

@ -89,7 +89,7 @@ fetch_osf_core_registers (struct regcache *regcache,
for (regno = 0; regno < ALPHA_NUM_REGS; regno++) for (regno = 0; regno < ALPHA_NUM_REGS; regno++)
{ {
if (CANNOT_FETCH_REGISTER (regno)) if (gdbarch_cannot_fetch_register (current_gdbarch, regno))
{ {
regcache_raw_supply (regcache, regno, NULL); regcache_raw_supply (regcache, regno, NULL);
continue; continue;

View file

@ -757,12 +757,6 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
fprintf_unfiltered (file, fprintf_unfiltered (file,
"gdbarch_dump: call_dummy_location = %s\n", "gdbarch_dump: call_dummy_location = %s\n",
paddr_d (current_gdbarch->call_dummy_location)); paddr_d (current_gdbarch->call_dummy_location));
#ifdef CANNOT_FETCH_REGISTER
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"CANNOT_FETCH_REGISTER(regnum)",
XSTRING (CANNOT_FETCH_REGISTER (regnum)));
#endif
fprintf_unfiltered (file, fprintf_unfiltered (file,
"gdbarch_dump: cannot_fetch_register = <0x%lx>\n", "gdbarch_dump: cannot_fetch_register = <0x%lx>\n",
(long) current_gdbarch->cannot_fetch_register); (long) current_gdbarch->cannot_fetch_register);
@ -774,12 +768,6 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
fprintf_unfiltered (file, fprintf_unfiltered (file,
"gdbarch_dump: cannot_step_breakpoint = %s\n", "gdbarch_dump: cannot_step_breakpoint = %s\n",
paddr_d (current_gdbarch->cannot_step_breakpoint)); paddr_d (current_gdbarch->cannot_step_breakpoint));
#ifdef CANNOT_STORE_REGISTER
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"CANNOT_STORE_REGISTER(regnum)",
XSTRING (CANNOT_STORE_REGISTER (regnum)));
#endif
fprintf_unfiltered (file, fprintf_unfiltered (file,
"gdbarch_dump: cannot_store_register = <0x%lx>\n", "gdbarch_dump: cannot_store_register = <0x%lx>\n",
(long) current_gdbarch->cannot_store_register); (long) current_gdbarch->cannot_store_register);

View file

@ -542,22 +542,10 @@ extern void set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch, gdbarch_regi
typedef int (gdbarch_cannot_fetch_register_ftype) (int regnum); typedef int (gdbarch_cannot_fetch_register_ftype) (int regnum);
extern int gdbarch_cannot_fetch_register (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); extern void set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, gdbarch_cannot_fetch_register_ftype *cannot_fetch_register);
#if !defined (GDB_TM_FILE) && defined (CANNOT_FETCH_REGISTER)
#error "Non multi-arch definition of CANNOT_FETCH_REGISTER"
#endif
#if !defined (CANNOT_FETCH_REGISTER)
#define CANNOT_FETCH_REGISTER(regnum) (gdbarch_cannot_fetch_register (current_gdbarch, regnum))
#endif
typedef int (gdbarch_cannot_store_register_ftype) (int regnum); typedef int (gdbarch_cannot_store_register_ftype) (int regnum);
extern int gdbarch_cannot_store_register (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); extern void set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, gdbarch_cannot_store_register_ftype *cannot_store_register);
#if !defined (GDB_TM_FILE) && defined (CANNOT_STORE_REGISTER)
#error "Non multi-arch definition of CANNOT_STORE_REGISTER"
#endif
#if !defined (CANNOT_STORE_REGISTER)
#define CANNOT_STORE_REGISTER(regnum) (gdbarch_cannot_store_register (current_gdbarch, regnum))
#endif
/* setjmp/longjmp support. */ /* setjmp/longjmp support. */

View file

@ -480,8 +480,8 @@ M::void:print_vector_info:struct ui_file *file, struct frame_info *frame, const
# also include/...-sim.h. # also include/...-sim.h.
f:=:int:register_sim_regno:int reg_nr:reg_nr::legacy_register_sim_regno::0 f:=:int:register_sim_regno:int reg_nr:reg_nr::legacy_register_sim_regno::0
F:=:int:register_bytes_ok:long nr_bytes:nr_bytes F:=:int:register_bytes_ok:long nr_bytes:nr_bytes
f:=:int:cannot_fetch_register:int regnum:regnum::cannot_register_not::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 f::int:cannot_store_register:int regnum:regnum::cannot_register_not::0
# setjmp/longjmp support. # setjmp/longjmp support.
F:=:int:get_longjmp_target:CORE_ADDR *pc:pc F:=:int:get_longjmp_target:CORE_ADDR *pc:pc
# #

View file

@ -221,7 +221,7 @@ fetch_register (struct regcache *regcache, int regno)
int tid; int tid;
int val; int val;
if (CANNOT_FETCH_REGISTER (regno)) if (gdbarch_cannot_fetch_register (current_gdbarch, regno))
{ {
regcache_raw_supply (regcache, regno, NULL); regcache_raw_supply (regcache, regno, NULL);
return; return;
@ -249,7 +249,7 @@ store_register (const struct regcache *regcache, int regno)
int tid; int tid;
int val; int val;
if (CANNOT_STORE_REGISTER (regno)) if (gdbarch_cannot_store_register (current_gdbarch, regno))
return; return;
/* GNU/Linux LWP ID's are process ID's. */ /* GNU/Linux LWP ID's are process ID's. */

View file

@ -626,7 +626,8 @@ inf_ptrace_fetch_register (struct regcache *regcache, int regnum)
/* This isn't really an address, but ptrace thinks of it as one. */ /* This isn't really an address, but ptrace thinks of it as one. */
addr = inf_ptrace_register_u_offset (current_gdbarch, regnum, 0); addr = inf_ptrace_register_u_offset (current_gdbarch, regnum, 0);
if (addr == (CORE_ADDR)-1 || CANNOT_FETCH_REGISTER (regnum)) if (addr == (CORE_ADDR)-1
|| gdbarch_cannot_fetch_register (current_gdbarch, regnum))
{ {
regcache_raw_supply (regcache, regnum, NULL); regcache_raw_supply (regcache, regnum, NULL);
return; return;
@ -681,7 +682,8 @@ inf_ptrace_store_register (const struct regcache *regcache, int regnum)
/* This isn't really an address, but ptrace thinks of it as one. */ /* This isn't really an address, but ptrace thinks of it as one. */
addr = inf_ptrace_register_u_offset (current_gdbarch, regnum, 1); addr = inf_ptrace_register_u_offset (current_gdbarch, regnum, 1);
if (addr == (CORE_ADDR)-1 || CANNOT_STORE_REGISTER (regnum)) if (addr == (CORE_ADDR)-1
|| gdbarch_cannot_store_register (current_gdbarch, regnum))
return; return;
/* Cater for systems like GNU/Linux, that implement threads as /* Cater for systems like GNU/Linux, that implement threads as

View file

@ -123,7 +123,7 @@ fetch_register (struct regcache *regcache, int regno)
char buf[MAX_REGISTER_SIZE]; char buf[MAX_REGISTER_SIZE];
int tid; int tid;
if (CANNOT_FETCH_REGISTER (regno)) if (gdbarch_cannot_fetch_register (current_gdbarch, regno))
{ {
memset (buf, '\0', register_size (current_gdbarch, regno)); /* Supply zeroes */ memset (buf, '\0', register_size (current_gdbarch, regno)); /* Supply zeroes */
regcache_raw_supply (regcache, regno, buf); regcache_raw_supply (regcache, regno, buf);
@ -185,10 +185,8 @@ store_register (const struct regcache *regcache, int regno)
int tid; int tid;
char buf[MAX_REGISTER_SIZE]; char buf[MAX_REGISTER_SIZE];
if (CANNOT_STORE_REGISTER (regno)) if (gdbarch_cannot_store_register (current_gdbarch, regno))
{ return;
return;
}
/* Overload thread id onto process id */ /* Overload thread id onto process id */
tid = TIDGET (inferior_ptid); tid = TIDGET (inferior_ptid);

View file

@ -150,7 +150,7 @@ mipsnbsd_supply_reg (struct regcache *regcache, const char *regs, int regno)
{ {
if (regno == i || regno == -1) if (regno == i || regno == -1)
{ {
if (CANNOT_FETCH_REGISTER (i)) if (gdbarch_cannot_fetch_register (current_gdbarch, i))
regcache_raw_supply (regcache, i, NULL); regcache_raw_supply (regcache, i, NULL);
else else
regcache_raw_supply (regcache, i, regcache_raw_supply (regcache, i,
@ -165,7 +165,8 @@ mipsnbsd_fill_reg (const struct regcache *regcache, char *regs, int regno)
int i; int i;
for (i = 0; i <= PC_REGNUM; i++) for (i = 0; i <= PC_REGNUM; i++)
if ((regno == i || regno == -1) && ! CANNOT_STORE_REGISTER (i)) if ((regno == i || regno == -1)
&& ! gdbarch_cannot_store_register (current_gdbarch, i))
regcache_raw_collect (regcache, i, regcache_raw_collect (regcache, i,
regs + (i * mips_isa_regsize (current_gdbarch))); regs + (i * mips_isa_regsize (current_gdbarch)));
} }
@ -181,7 +182,7 @@ mipsnbsd_supply_fpreg (struct regcache *regcache, const char *fpregs, int regno)
{ {
if (regno == i || regno == -1) if (regno == i || regno == -1)
{ {
if (CANNOT_FETCH_REGISTER (i)) if (gdbarch_cannot_fetch_register (current_gdbarch, i))
regcache_raw_supply (regcache, i, NULL); regcache_raw_supply (regcache, i, NULL);
else else
regcache_raw_supply (regcache, i, regcache_raw_supply (regcache, i,
@ -197,7 +198,8 @@ mipsnbsd_fill_fpreg (const struct regcache *regcache, char *fpregs, int regno)
for (i = FP0_REGNUM; i <= mips_regnum (current_gdbarch)->fp_control_status; for (i = FP0_REGNUM; i <= mips_regnum (current_gdbarch)->fp_control_status;
i++) i++)
if ((regno == i || regno == -1) && ! CANNOT_STORE_REGISTER (i)) if ((regno == i || regno == -1)
&& ! gdbarch_cannot_store_register (current_gdbarch, i))
regcache_raw_collect (regcache, i, regcache_raw_collect (regcache, i,
fpregs + ((i - FP0_REGNUM) * mips_isa_regsize (current_gdbarch))); fpregs + ((i - FP0_REGNUM) * mips_isa_regsize (current_gdbarch)));
} }

View file

@ -616,7 +616,7 @@ regcache_raw_write (struct regcache *regcache, int regnum,
/* On the sparc, writing %g0 is a no-op, so we don't even want to /* On the sparc, writing %g0 is a no-op, so we don't even want to
change the registers array if something writes to this register. */ change the registers array if something writes to this register. */
if (CANNOT_STORE_REGISTER (regnum)) if (gdbarch_cannot_store_register (current_gdbarch, regnum))
return; return;
/* Make certain that the correct cache is selected. */ /* Make certain that the correct cache is selected. */