*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / values.c
index aba500cfbecd3b1e26bea8a5c5da69216eadbe9b..f468ff8abf7d6c1c0582caf7dff2b5516970b8f6 100644 (file)
@@ -1223,7 +1223,7 @@ register_value_being_returned (struct type *valtype, struct regcache *retbuf)
   struct value *val = allocate_value (valtype);
 
   /* If the function returns void, don't bother fetching the return
-     value.  */
+     value.  See also "using_struct_return".  */
   if (TYPE_CODE (valtype) == TYPE_CODE_VOID)
     return val;
 
@@ -1243,13 +1243,13 @@ register_value_being_returned (struct type *valtype, struct regcache *retbuf)
                                    NULL, NULL, NULL)
              == RETURN_VALUE_REGISTER_CONVENTION);
   gdbarch_return_value (current_gdbarch, valtype, retbuf,
-                       NULL, VALUE_CONTENTS_RAW (val));
+                       VALUE_CONTENTS_RAW (val) /*read*/, NULL /*write*/);
   return val;
 }
 
-/* Should we use EXTRACT_STRUCT_VALUE_ADDRESS instead of
-   EXTRACT_RETURN_VALUE?  GCC_P is true if compiled with gcc
-   and TYPE is the type (which is known to be struct, union or array).
+/* Should we use DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS instead of
+   EXTRACT_RETURN_VALUE?  GCC_P is true if compiled with gcc and TYPE
+   is the type (which is known to be struct, union or array).
 
    On most machines, the struct convention is used unless we are
    using gcc and the type is of a special size.  */
@@ -1285,6 +1285,11 @@ using_struct_return (struct type *value_type, int gcc_p)
   if (code == TYPE_CODE_ERROR)
     error ("Function return type unknown.");
 
+  if (code == TYPE_CODE_VOID)
+    /* A void return value is never in memory.  See also corresponding
+       code in "register_value_being_returned".  */
+    return 0;
+
   if (!gdbarch_return_value_p (current_gdbarch))
     {
       /* FIXME: cagney/2003-10-01: The below is dead.  Instead an
@@ -1303,7 +1308,7 @@ using_struct_return (struct type *value_type, int gcc_p)
   /* Probe the architecture for the return-value convention.  */
   return (gdbarch_return_value (current_gdbarch, value_type,
                                NULL, NULL, NULL)
-         == RETURN_VALUE_STRUCT_CONVENTION);
+         != RETURN_VALUE_REGISTER_CONVENTION);
 }
 
 void
This page took 0.024739 seconds and 4 git commands to generate.