aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/gdbarch.c30
-rw-r--r--gdb/gdbarch.h30
-rwxr-xr-xgdb/gdbarch.sh15
-rw-r--r--gdb/regcache.c29
5 files changed, 57 insertions, 55 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a19064e..48a6c19 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2000-08-10 Andrew Cagney <cagney@ops1.cygnus.com>
+
+ * regcache.c (TARGET_WRITE_PC, TARGET_READ_PC, TARGET_READ_FP,
+ TARGET_WRITE_FP, TARGET_READ_SP, TARGET_WRITE_SP): Move
+ initialization from here.
+ * gdbarch.sh: To here.
+ * gdbarch.h, gdbarch.c: Regenerate.
+
Thu Aug 10 18:58:04 2000 Andrew Cagney <cagney@makita.cygnus.com>
* defs.h (TARGET_BFD_VMA_BIT, TARGET_SHORT_BIT, TARGET_INT_BIT,
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 31993f1..aa62d13 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -383,6 +383,12 @@ gdbarch_alloc (const struct gdbarch_info *info,
gdbarch->long_double_bit = 2*TARGET_DOUBLE_BIT;
gdbarch->ptr_bit = TARGET_INT_BIT;
gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
+ gdbarch->read_pc = generic_target_read_pc;
+ gdbarch->write_pc = generic_target_write_pc;
+ gdbarch->read_fp = generic_target_read_fp;
+ gdbarch->write_fp = generic_target_write_fp;
+ gdbarch->read_sp = generic_target_read_sp;
+ gdbarch->write_sp = generic_target_write_sp;
gdbarch->num_regs = -1;
gdbarch->sp_regnum = -1;
gdbarch->fp_regnum = -1;
@@ -465,24 +471,12 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of ptr_bit, invalid_p == 0 */
/* Skip verify of bfd_vma_bit, invalid_p == 0 */
/* Skip verify of ieee_float, invalid_p == 0 */
- if ((GDB_MULTI_ARCH >= 1)
- && (gdbarch->read_pc == 0))
- internal_error ("gdbarch: verify_gdbarch: read_pc invalid");
- if ((GDB_MULTI_ARCH >= 1)
- && (gdbarch->write_pc == 0))
- internal_error ("gdbarch: verify_gdbarch: write_pc invalid");
- if ((GDB_MULTI_ARCH >= 1)
- && (gdbarch->read_fp == 0))
- internal_error ("gdbarch: verify_gdbarch: read_fp invalid");
- if ((GDB_MULTI_ARCH >= 1)
- && (gdbarch->write_fp == 0))
- internal_error ("gdbarch: verify_gdbarch: write_fp invalid");
- if ((GDB_MULTI_ARCH >= 1)
- && (gdbarch->read_sp == 0))
- internal_error ("gdbarch: verify_gdbarch: read_sp invalid");
- if ((GDB_MULTI_ARCH >= 1)
- && (gdbarch->write_sp == 0))
- internal_error ("gdbarch: verify_gdbarch: write_sp invalid");
+ /* Skip verify of read_pc, invalid_p == 0 */
+ /* Skip verify of write_pc, invalid_p == 0 */
+ /* Skip verify of read_fp, invalid_p == 0 */
+ /* Skip verify of write_fp, invalid_p == 0 */
+ /* Skip verify of read_sp, invalid_p == 0 */
+ /* Skip verify of write_sp, invalid_p == 0 */
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->num_regs == -1))
internal_error ("gdbarch: verify_gdbarch: num_regs invalid");
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index fb07b93..0b8b641 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -232,6 +232,11 @@ extern void set_gdbarch_ieee_float (struct gdbarch *gdbarch, int ieee_float);
#endif
#endif
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_PC)
+#define TARGET_READ_PC(pid) (generic_target_read_pc (pid))
+#endif
+
typedef CORE_ADDR (gdbarch_read_pc_ftype) (int pid);
extern CORE_ADDR gdbarch_read_pc (struct gdbarch *gdbarch, int pid);
extern void set_gdbarch_read_pc (struct gdbarch *gdbarch, gdbarch_read_pc_ftype *read_pc);
@@ -241,6 +246,11 @@ extern void set_gdbarch_read_pc (struct gdbarch *gdbarch, gdbarch_read_pc_ftype
#endif
#endif
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_WRITE_PC)
+#define TARGET_WRITE_PC(val, pid) (generic_target_write_pc (val, pid))
+#endif
+
typedef void (gdbarch_write_pc_ftype) (CORE_ADDR val, int pid);
extern void gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, int pid);
extern void set_gdbarch_write_pc (struct gdbarch *gdbarch, gdbarch_write_pc_ftype *write_pc);
@@ -250,6 +260,11 @@ extern void set_gdbarch_write_pc (struct gdbarch *gdbarch, gdbarch_write_pc_ftyp
#endif
#endif
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_FP)
+#define TARGET_READ_FP() (generic_target_read_fp ())
+#endif
+
typedef CORE_ADDR (gdbarch_read_fp_ftype) (void);
extern CORE_ADDR gdbarch_read_fp (struct gdbarch *gdbarch);
extern void set_gdbarch_read_fp (struct gdbarch *gdbarch, gdbarch_read_fp_ftype *read_fp);
@@ -259,6 +274,11 @@ extern void set_gdbarch_read_fp (struct gdbarch *gdbarch, gdbarch_read_fp_ftype
#endif
#endif
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_WRITE_FP)
+#define TARGET_WRITE_FP(val) (generic_target_write_fp (val))
+#endif
+
typedef void (gdbarch_write_fp_ftype) (CORE_ADDR val);
extern void gdbarch_write_fp (struct gdbarch *gdbarch, CORE_ADDR val);
extern void set_gdbarch_write_fp (struct gdbarch *gdbarch, gdbarch_write_fp_ftype *write_fp);
@@ -268,6 +288,11 @@ extern void set_gdbarch_write_fp (struct gdbarch *gdbarch, gdbarch_write_fp_ftyp
#endif
#endif
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_SP)
+#define TARGET_READ_SP() (generic_target_read_sp ())
+#endif
+
typedef CORE_ADDR (gdbarch_read_sp_ftype) (void);
extern CORE_ADDR gdbarch_read_sp (struct gdbarch *gdbarch);
extern void set_gdbarch_read_sp (struct gdbarch *gdbarch, gdbarch_read_sp_ftype *read_sp);
@@ -277,6 +302,11 @@ extern void set_gdbarch_read_sp (struct gdbarch *gdbarch, gdbarch_read_sp_ftype
#endif
#endif
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_WRITE_SP)
+#define TARGET_WRITE_SP(val) (generic_target_write_sp (val))
+#endif
+
typedef void (gdbarch_write_sp_ftype) (CORE_ADDR val);
extern void gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val);
extern void set_gdbarch_write_sp (struct gdbarch *gdbarch, gdbarch_write_sp_ftype *write_sp);
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 9f25818..2cffe3e 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -324,15 +324,14 @@ v::TARGET_PTR_BIT:int:ptr_bit::::8 * sizeof (void*):TARGET_INT_BIT::0
# Number of bits in a BFD_VMA for the target object file format.
v::TARGET_BFD_VMA_BIT:int:bfd_vma_bit::::8 * sizeof (void*):TARGET_ARCHITECTURE->bits_per_address::0
#
-v:1:IEEE_FLOAT:int:ieee_float::::0:0::0:::
-#
-f:1:TARGET_READ_PC:CORE_ADDR:read_pc:int pid:pid::0:0
-f:1:TARGET_WRITE_PC:void:write_pc:CORE_ADDR val, int pid:val, pid::0:0
-f:1:TARGET_READ_FP:CORE_ADDR:read_fp:void:::0:0
-f:1:TARGET_WRITE_FP:void:write_fp:CORE_ADDR val:val::0:0
-f:1:TARGET_READ_SP:CORE_ADDR:read_sp:void:::0:0
-f:1:TARGET_WRITE_SP:void:write_sp:CORE_ADDR val:val::0:0
+v::IEEE_FLOAT:int:ieee_float::::0:0::0:::
#
+f::TARGET_READ_PC:CORE_ADDR:read_pc:int pid:pid::0:generic_target_read_pc::0
+f::TARGET_WRITE_PC:void:write_pc:CORE_ADDR val, int pid:val, pid::0:generic_target_write_pc::0
+f::TARGET_READ_FP:CORE_ADDR:read_fp:void:::0:generic_target_read_fp::0
+f::TARGET_WRITE_FP:void:write_fp:CORE_ADDR val:val::0:generic_target_write_fp::0
+f::TARGET_READ_SP:CORE_ADDR:read_sp:void:::0:generic_target_read_sp::0
+f::TARGET_WRITE_SP:void:write_sp:CORE_ADDR val:val::0:generic_target_write_sp::0
#
v:2:NUM_REGS:int:num_regs::::0:-1
# This macro gives the number of pseudo-registers that live in the
diff --git a/gdb/regcache.c b/gdb/regcache.c
index f449189..337f57a 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -200,11 +200,6 @@ default_get_saved_register (char *raw_buffer,
*addrp = addr;
}
-#if !defined (GET_SAVED_REGISTER)
-#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \
- default_get_saved_register(raw_buffer, optimized, addrp, frame, regnum, lval)
-#endif
-
void
get_saved_register (char *raw_buffer,
int *optimized,
@@ -715,10 +710,6 @@ supply_register (int regno, char *val)
eliminate the intermediate read_pc_pid(). The client would call
TARGET_READ_PC directly. (cagney). */
-#ifndef TARGET_READ_PC
-#define TARGET_READ_PC generic_target_read_pc
-#endif
-
CORE_ADDR
generic_target_read_pc (int pid)
{
@@ -755,10 +746,6 @@ read_pc (void)
return read_pc_pid (inferior_pid);
}
-#ifndef TARGET_WRITE_PC
-#define TARGET_WRITE_PC generic_target_write_pc
-#endif
-
void
generic_target_write_pc (CORE_ADDR pc, int pid)
{
@@ -796,10 +783,6 @@ write_pc (CORE_ADDR pc)
/* Cope with strage ways of getting to the stack and frame pointers */
-#ifndef TARGET_READ_SP
-#define TARGET_READ_SP generic_target_read_sp
-#endif
-
CORE_ADDR
generic_target_read_sp (void)
{
@@ -816,10 +799,6 @@ read_sp (void)
return TARGET_READ_SP ();
}
-#ifndef TARGET_WRITE_SP
-#define TARGET_WRITE_SP generic_target_write_sp
-#endif
-
void
generic_target_write_sp (CORE_ADDR val)
{
@@ -839,10 +818,6 @@ write_sp (CORE_ADDR val)
TARGET_WRITE_SP (val);
}
-#ifndef TARGET_READ_FP
-#define TARGET_READ_FP generic_target_read_fp
-#endif
-
CORE_ADDR
generic_target_read_fp (void)
{
@@ -859,10 +834,6 @@ read_fp (void)
return TARGET_READ_FP ();
}
-#ifndef TARGET_WRITE_FP
-#define TARGET_WRITE_FP generic_target_write_fp
-#endif
-
void
generic_target_write_fp (CORE_ADDR val)
{