aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Deuling <deuling@de.ibm.com>2007-11-16 04:56:45 +0000
committerMarkus Deuling <deuling@de.ibm.com>2007-11-16 04:56:45 +0000
commit64a3914f1d067cda3ec88333e5312afe133d5d36 (patch)
treea182e9030a0bb5ff6636b988e9df4360e3a8f84f
parent40a6adc1f847a722db47fa6dc14e4664d59f07b6 (diff)
downloadgdb-64a3914f1d067cda3ec88333e5312afe133d5d36.zip
gdb-64a3914f1d067cda3ec88333e5312afe133d5d36.tar.gz
gdb-64a3914f1d067cda3ec88333e5312afe133d5d36.tar.bz2
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.
-rw-r--r--gdb/ChangeLog20
-rw-r--r--gdb/alpha-tdep.c8
-rw-r--r--gdb/arch-utils.c2
-rw-r--r--gdb/arch-utils.h2
-rw-r--r--gdb/cris-tdep.c16
-rw-r--r--gdb/gdbarch.c8
-rw-r--r--gdb/gdbarch.h4
-rwxr-xr-xgdb/gdbarch.sh4
-rw-r--r--gdb/hppa-tdep.c12
-rw-r--r--gdb/mipsnbsd-tdep.c8
10 files changed, 52 insertions, 32 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9a4a3bc..75a52da 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,25 @@
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
the current architecture by regcache.
* ppcnbsd-nat.c (ppcnbsd_supply_pcb): Likewise.
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index d3bc0c8..cf3bd7d 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -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 *
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 52f4e74..c56b983 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -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;
}
diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h
index ee04ad5..8d87fbf 100644
--- a/gdb/arch-utils.h
+++ b/gdb/arch-utils.h
@@ -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
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index 4cbde58..9e560cf 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -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;
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index c5e1649..88862c4 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -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
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 355054a..5e39512 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -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);
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index c8af60a..010268a 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -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
#
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index cbdcd90..a484ac8 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -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
diff --git a/gdb/mipsnbsd-tdep.c b/gdb/mipsnbsd-tdep.c
index f4805a6..dd55f95 100644
--- a/gdb/mipsnbsd-tdep.c
+++ b/gdb/mipsnbsd-tdep.c
@@ -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. */