aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.h
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-07-03 21:27:55 +0000
committerAndrew Cagney <cagney@redhat.com>2002-07-03 21:27:55 +0000
commit049ee0e44d23a32d5de40a7259b50e78ff13a450 (patch)
treed182e96cbab1b1f3dd64b3245fa6a386d56eaa2c /gdb/gdbarch.h
parent4e0d9804feffffee56f37acb75ee8dbd9f67c4a6 (diff)
downloadgdb-049ee0e44d23a32d5de40a7259b50e78ff13a450.zip
gdb-049ee0e44d23a32d5de40a7259b50e78ff13a450.tar.gz
gdb-049ee0e44d23a32d5de40a7259b50e78ff13a450.tar.bz2
* gdbarch.sh (struct regcache): Add opaque declaration.
(EXTRACT_RETURN_VALUE): New architecture method. (EXTRACT_STRUCT_VALUE_ADDRESS): Ditto. * gdbarch.h, gdbarch.c: Regenerate. * arch-utils.c (legacy_extract_return_value): New function. * arch-utils.h (legacy_extract_return_value): Declare. * values.c (value_being_returned): Re-enable code handling EXTRACT_STRUCT_VALUE_ADDRESS. Move deprecated_grub_regcache_for_registers call to block handling DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS. (EXTRACT_RETURN_VALUE): Do not define.
Diffstat (limited to 'gdb/gdbarch.h')
-rw-r--r--gdb/gdbarch.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index aeb4747..c1443c8 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -46,6 +46,7 @@ struct frame_info;
struct value;
struct objfile;
struct minimal_symbol;
+struct regcache;
extern struct gdbarch *current_gdbarch;
@@ -1460,6 +1461,23 @@ extern void set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, gdbarch_
#endif
#endif
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (EXTRACT_RETURN_VALUE)
+#define EXTRACT_RETURN_VALUE(type, regcache, valbuf) (legacy_extract_return_value (type, regcache, valbuf))
+#endif
+
+typedef void (gdbarch_extract_return_value_ftype) (struct type *type, struct regcache *regcache, char *valbuf);
+extern void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, char *valbuf);
+extern void set_gdbarch_extract_return_value (struct gdbarch *gdbarch, gdbarch_extract_return_value_ftype *extract_return_value);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_RETURN_VALUE)
+#error "Non multi-arch definition of EXTRACT_RETURN_VALUE"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_RETURN_VALUE)
+#define EXTRACT_RETURN_VALUE(type, regcache, valbuf) (gdbarch_extract_return_value (current_gdbarch, type, regcache, valbuf))
+#endif
+#endif
+
typedef void (gdbarch_deprecated_extract_return_value_ftype) (struct type *type, char *regbuf, char *valbuf);
extern void gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf);
extern void set_gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, gdbarch_deprecated_extract_return_value_ftype *deprecated_extract_return_value);
@@ -1574,6 +1592,43 @@ extern void set_gdbarch_store_return_value (struct gdbarch *gdbarch, gdbarch_sto
#endif
#endif
+#if defined (EXTRACT_STRUCT_VALUE_ADDRESS)
+/* Legacy for systems yet to multi-arch EXTRACT_STRUCT_VALUE_ADDRESS */
+#if !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
+#define EXTRACT_STRUCT_VALUE_ADDRESS_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
+#define EXTRACT_STRUCT_VALUE_ADDRESS_P() (0)
+#endif
+
+extern int gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
+#error "Non multi-arch definition of EXTRACT_STRUCT_VALUE_ADDRESS"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
+#define EXTRACT_STRUCT_VALUE_ADDRESS_P() (gdbarch_extract_struct_value_address_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (EXTRACT_STRUCT_VALUE_ADDRESS)
+#define EXTRACT_STRUCT_VALUE_ADDRESS(regcache) (internal_error (__FILE__, __LINE__, "EXTRACT_STRUCT_VALUE_ADDRESS"), 0)
+#endif
+
+typedef CORE_ADDR (gdbarch_extract_struct_value_address_ftype) (struct regcache *regcache);
+extern CORE_ADDR gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache);
+extern void set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_extract_struct_value_address_ftype *extract_struct_value_address);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_STRUCT_VALUE_ADDRESS)
+#error "Non multi-arch definition of EXTRACT_STRUCT_VALUE_ADDRESS"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS)
+#define EXTRACT_STRUCT_VALUE_ADDRESS(regcache) (gdbarch_extract_struct_value_address (current_gdbarch, regcache))
+#endif
+#endif
+
#if defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS)
/* Legacy for systems yet to multi-arch DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS */
#if !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P)