2003-10-06 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / infcall.c
index 0477d1ebe010951646a9ba84dbb41f685e5546aa..f9cb87e89d45a22c0cbe8b073fc85776b9ddf852 100644 (file)
@@ -1076,6 +1076,8 @@ the function call).", name);
      address of the returned structure. Usually this will be
      overwritten by the callee.  I don't know about other
      architectures, so I defined this macro */
+  /* FIXME: cagney/2003-09-27: This is no longer needed.  The problem
+     is now handled directly be by the code below.  */
 #ifdef DEPRECATED_VALUE_RETURNED_FROM_STACK
   if (struct_return)
     {
@@ -1083,23 +1085,25 @@ the function call).", name);
       return DEPRECATED_VALUE_RETURNED_FROM_STACK (value_type, struct_addr);
     }
 #endif
-  /* NOTE: cagney/2002-09-10: Only when the stack has been correctly
-     aligned (using frame_align()) do we can trust STRUCT_ADDR and
-     fetch the return value direct from the stack.  This lack of trust
-     comes about because legacy targets have a nasty habit of
-     silently, and local to PUSH_ARGUMENTS(), moving STRUCT_ADDR.  For
-     such targets, just hope that value_being_returned() can find the
-     adjusted value.  */
-  if (struct_return && gdbarch_frame_align_p (current_gdbarch))
+  if (struct_return)
     {
+      /* NOTE: cagney/2003-09-27: This assumes that PUSH_DUMMY_CALL
+        has correctly stored STRUCT_ADDR in the target.  In the past
+        that hasn't been the case, the old MIPS PUSH_ARGUMENTS
+        (PUSH_DUMMY_CALL precursor) would silently move the location
+        of the struct return value making STRUCT_ADDR bogus.  If
+        you're seeing problems with values being returned using the
+        "struct return convention", check that PUSH_DUMMY_CALL isn't
+        playing tricks.  */
       struct value *retval = value_at (value_type, struct_addr, NULL);
       do_cleanups (retbuf_cleanup);
       return retval;
     }
   else
     {
-      struct value *retval = value_being_returned (value_type, retbuf,
-                                                  struct_return);
+      /* The non-register case was handled above.  */
+      struct value *retval = register_value_being_returned (value_type,
+                                                           retbuf);
       do_cleanups (retbuf_cleanup);
       return retval;
     }
This page took 0.023544 seconds and 4 git commands to generate.