aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.h
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-05-04 17:34:51 +0000
committerAndrew Cagney <cagney@redhat.com>2003-05-04 17:34:51 +0000
commit46654a5bcc3430a7219b2a8430578b4a5473214c (patch)
tree499f90a477c3f8c9ffa026a4768d18ca1ccbaa42 /gdb/gdbarch.h
parent54ff5908500fc0a8e83fcd8ffa779bf81eebd51b (diff)
downloadgdb-46654a5bcc3430a7219b2a8430578b4a5473214c.zip
gdb-46654a5bcc3430a7219b2a8430578b4a5473214c.tar.gz
gdb-46654a5bcc3430a7219b2a8430578b4a5473214c.tar.bz2
2003-05-02 Andrew Cagney <cagney@redhat.com>
* sentinel-frame.c (sentinel_frame_prev_register): Replace REGISTER_BYTE with register_offset_hack. * regcache.c (init_regcache_descr): When REGISTER_BYTE_P, check that REGISTER_BYTE is consistent with the regcache. * gdbarch.sh (REGISTER_BYTE): Add a predicate. * gdbarch.h, gdbarch.c: Regenerate.
Diffstat (limited to 'gdb/gdbarch.h')
-rw-r--r--gdb/gdbarch.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index f00cc34..7cbb19c 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -739,6 +739,32 @@ extern void set_gdbarch_register_bytes (struct gdbarch *gdbarch, int register_by
#define REGISTER_BYTES (gdbarch_register_bytes (current_gdbarch))
#endif
+/* NOTE: cagney/2002-05-02: This function with predicate has a valid
+ (callable) initial value. As a consequence, even when the predicate
+ is false, the corresponding function works. This simplifies the
+ migration process - old code, calling REGISTER_BYTE, doesn't need to
+ be modified. */
+
+#if defined (REGISTER_BYTE)
+/* Legacy for systems yet to multi-arch REGISTER_BYTE */
+#if !defined (REGISTER_BYTE_P)
+#define REGISTER_BYTE_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTE_P)
+#define REGISTER_BYTE_P() (0)
+#endif
+
+extern int gdbarch_register_byte_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTE_P)
+#error "Non multi-arch definition of REGISTER_BYTE"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTE_P)
+#define REGISTER_BYTE_P() (gdbarch_register_byte_p (current_gdbarch))
+#endif
+
/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTE)
#define REGISTER_BYTE(reg_nr) (generic_register_byte (reg_nr))