* gdbarch.sh (EXTRACT_STRUCT_VALUE_ADDRESS_P): Delete definition.
authorAndrew Cagney <cagney@redhat.com>
Fri, 15 Jun 2001 19:19:23 +0000 (19:19 +0000)
committerAndrew Cagney <cagney@redhat.com>
Fri, 15 Jun 2001 19:19:23 +0000 (19:19 +0000)
(EXTRACT_STRUCT_VALUE_ADDRESS): Change to a function with
predicate.
* gdbarch.h, gdbarch.c: Regenerate.
* values.c (value_being_returned): Change the reference to
EXTRACT_STRUCT_VALUE_ADDRESS_P to a function call.

gdb/ChangeLog
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/values.c

index a510856d12c61d5f638342364d11fc6c6e1f8510..68450124dda567e09b52fe9b1735db86d6a6558d 100644 (file)
@@ -1,3 +1,12 @@
+2001-06-15  Andrew Cagney  <ac131313@redhat.com>
+
+       * gdbarch.sh (EXTRACT_STRUCT_VALUE_ADDRESS_P): Delete definition.
+       (EXTRACT_STRUCT_VALUE_ADDRESS): Change to a function with
+       predicate.
+       * gdbarch.h, gdbarch.c: Regenerate.
+       * values.c (value_being_returned): Change the reference to
+       EXTRACT_STRUCT_VALUE_ADDRESS_P to a function call.
+
 2001-06-15  Joel Brobecker <brobecker@act-europe.fr>
 
         * MAINTAINERS: Add Paul Hilfinger and Joel Brobecker to the
index 95e9044a4763227bfd2fb49e3cfe6d17c7f677dc..435b36cc450e446f3677721e76913f92efe7202b 100644 (file)
@@ -690,10 +690,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
       && (gdbarch->store_return_value == 0))
     internal_error (__FILE__, __LINE__,
                     "gdbarch: verify_gdbarch: store_return_value invalid");
-  if ((GDB_MULTI_ARCH >= 2)
-      && (gdbarch->extract_struct_value_address == 0))
-    internal_error (__FILE__, __LINE__,
-                    "gdbarch: verify_gdbarch: extract_struct_value_address invalid");
+  /* Skip verify of extract_struct_value_address, has predicate */
   if ((GDB_MULTI_ARCH >= 2)
       && (gdbarch->use_struct_convention == 0))
     internal_error (__FILE__, __LINE__,
@@ -3696,6 +3693,12 @@ set_gdbarch_store_return_value (struct gdbarch *gdbarch,
   gdbarch->store_return_value = store_return_value;
 }
 
+int
+gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch)
+{
+  return gdbarch->extract_struct_value_address != 0;
+}
+
 CORE_ADDR
 gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf)
 {
index 2e9d35f28ecf1108044595e6132d998a6aae0931..51cc4401af82c28adfbdfc12b011b533ada008a8 100644 (file)
@@ -1097,6 +1097,28 @@ 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)
+#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(regbuf) (internal_error (__FILE__, __LINE__, "EXTRACT_STRUCT_VALUE_ADDRESS"), 0)
+#endif
+
 typedef CORE_ADDR (gdbarch_extract_struct_value_address_ftype) (char *regbuf);
 extern CORE_ADDR gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf);
 extern void set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_extract_struct_value_address_ftype *extract_struct_value_address);
@@ -1812,17 +1834,6 @@ extern disassemble_info tm_print_insn_info;
 #define GDB_TARGET_IS_D10V (TARGET_ARCHITECTURE->arch == bfd_arch_d10v)
 
 
-/* Fallback definition for EXTRACT_STRUCT_VALUE_ADDRESS */
-#ifndef EXTRACT_STRUCT_VALUE_ADDRESS
-#define EXTRACT_STRUCT_VALUE_ADDRESS_P (0)
-#define EXTRACT_STRUCT_VALUE_ADDRESS(X) (internal_error (__FILE__, __LINE__, "gdbarch: EXTRACT_STRUCT_VALUE_ADDRESS"), 0)
-#else
-#ifndef EXTRACT_STRUCT_VALUE_ADDRESS_P
-#define EXTRACT_STRUCT_VALUE_ADDRESS_P (1)
-#endif
-#endif
-
-
 /* Set the dynamic target-system-dependent parameters (architecture,
    byte-order, ...) using information found in the BFD */
 
index 88ac95ccd5a0adb2dbdc4b8024e62f09b393387a..5a91981ba1166e2f4e88b656b57fe57e00bf0d61 100755 (executable)
@@ -476,7 +476,7 @@ f:2:D10V_CONVERT_IADDR_TO_RAW:CORE_ADDR:d10v_convert_iaddr_to_raw:CORE_ADDR x:x:
 #
 f:2:STORE_STRUCT_RETURN:void:store_struct_return:CORE_ADDR addr, CORE_ADDR sp:addr, sp:::0
 f:2:STORE_RETURN_VALUE:void:store_return_value:struct type *type, char *valbuf:type, valbuf:::0
-f:2:EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:extract_struct_value_address:char *regbuf:regbuf:::0
+F:2:EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:extract_struct_value_address:char *regbuf:regbuf:::0
 f:2:USE_STRUCT_CONVENTION:int:use_struct_convention:int gcc_p, struct type *value_type:gcc_p, value_type:::0
 #
 f:2:FRAME_INIT_SAVED_REGS:void:frame_init_saved_regs:struct frame_info *frame:frame::0:0
@@ -1043,17 +1043,6 @@ extern disassemble_info tm_print_insn_info;
 #define GDB_TARGET_IS_D10V (TARGET_ARCHITECTURE->arch == bfd_arch_d10v)
 
 
-/* Fallback definition for EXTRACT_STRUCT_VALUE_ADDRESS */
-#ifndef EXTRACT_STRUCT_VALUE_ADDRESS
-#define EXTRACT_STRUCT_VALUE_ADDRESS_P (0)
-#define EXTRACT_STRUCT_VALUE_ADDRESS(X) (internal_error (__FILE__, __LINE__, "gdbarch: EXTRACT_STRUCT_VALUE_ADDRESS"), 0)
-#else
-#ifndef EXTRACT_STRUCT_VALUE_ADDRESS_P
-#define EXTRACT_STRUCT_VALUE_ADDRESS_P (1)
-#endif
-#endif
-
-
 /* Set the dynamic target-system-dependent parameters (architecture,
    byte-order, ...) using information found in the BFD */
 
index bb441cd5ead27957ae249355a2b2dfcba12ae261..43ff194c160f611491ec4267a8b868be4209c92d 100644 (file)
@@ -1328,7 +1328,7 @@ value_being_returned (struct type *valtype, char *retbuf, int struct_return)
   CORE_ADDR addr;
 
   /* If this is not defined, just use EXTRACT_RETURN_VALUE instead.  */
-  if (EXTRACT_STRUCT_VALUE_ADDRESS_P)
+  if (EXTRACT_STRUCT_VALUE_ADDRESS_P ())
     if (struct_return)
       {
        addr = EXTRACT_STRUCT_VALUE_ADDRESS (retbuf);