aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.h
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2001-11-06 18:06:00 +0000
committerAndrew Cagney <cagney@redhat.com>2001-11-06 18:06:00 +0000
commit69a0d5f4faf69df010fda32619a31359d4bedf04 (patch)
treedf68e564237bc70eafdecf94786c3548605306e9 /gdb/gdbarch.h
parentf8deed93c68458a446ff52314e008c910e26a1a5 (diff)
downloadgdb-69a0d5f4faf69df010fda32619a31359d4bedf04.zip
gdb-69a0d5f4faf69df010fda32619a31359d4bedf04.tar.gz
gdb-69a0d5f4faf69df010fda32619a31359d4bedf04.tar.bz2
Add predicate for PUSH_RETURN_ADDRESS.
Diffstat (limited to 'gdb/gdbarch.h')
-rw-r--r--gdb/gdbarch.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index f41a35d..2ed6b21 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -1332,6 +1332,31 @@ extern void set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch, gdbarch_push_
#endif
#endif
+#if defined (PUSH_RETURN_ADDRESS)
+/* Legacy for systems yet to multi-arch PUSH_RETURN_ADDRESS */
+#if !defined (PUSH_RETURN_ADDRESS_P)
+#define PUSH_RETURN_ADDRESS_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (PUSH_RETURN_ADDRESS_P)
+#define PUSH_RETURN_ADDRESS_P() (0)
+#endif
+
+extern int gdbarch_push_return_address_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_RETURN_ADDRESS_P)
+#error "Non multi-arch definition of PUSH_RETURN_ADDRESS"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_RETURN_ADDRESS_P)
+#define PUSH_RETURN_ADDRESS_P() (gdbarch_push_return_address_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (PUSH_RETURN_ADDRESS)
+#define PUSH_RETURN_ADDRESS(pc, sp) (internal_error (__FILE__, __LINE__, "PUSH_RETURN_ADDRESS"), 0)
+#endif
+
typedef CORE_ADDR (gdbarch_push_return_address_ftype) (CORE_ADDR pc, CORE_ADDR sp);
extern CORE_ADDR gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp);
extern void set_gdbarch_push_return_address (struct gdbarch *gdbarch, gdbarch_push_return_address_ftype *push_return_address);