diff options
author | Andrew Cagney <cagney@redhat.com> | 2001-11-06 18:06:00 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2001-11-06 18:06:00 +0000 |
commit | 707f4928bc4f20fa74e853ac8985a3164e8b1f53 (patch) | |
tree | f59b36ed9b901b0352e66ea3d6e27f1398dc9408 /gdb/gdbarch.h | |
parent | 26e9886a98d2fab83a089b2b75634b1feb7daa11 (diff) | |
download | gdb-707f4928bc4f20fa74e853ac8985a3164e8b1f53.tar.gz |
Add predicate for PUSH_RETURN_ADDRESS.
Diffstat (limited to 'gdb/gdbarch.h')
-rw-r--r-- | gdb/gdbarch.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index f41a35d6d2b..2ed6b2143ea 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); |