]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2003-07-31 Michael Snyder <msnyder@redhat.com>
authorMichael Snyder <msnyder@vmware.com>
Thu, 31 Jul 2003 23:41:25 +0000 (23:41 +0000)
committerMichael Snyder <msnyder@vmware.com>
Thu, 31 Jul 2003 23:41:25 +0000 (23:41 +0000)
        * value.h, values.c, infcall.c, infcmd.c: Revert 07-30 change,
        which is already covered by the new frames infrastructure.

gdb/ChangeLog
gdb/infcall.c
gdb/infcmd.c
gdb/value.h
gdb/values.c

index 6765475a6197c694b451e0624437f876a5ab43d0..536f34f5e96731280c3ebd49ca5e848a2951f0ab 100644 (file)
@@ -1,3 +1,8 @@
+2003-07-31  Michael Snyder  <msnyder@redhat.com>
+
+       * value.h, values.c, infcall.c, infcmd.c: Revert 07-30 change,
+       which is already covered by the new frames infrastructure.
+
 2003-07-31  Andrew Cagney  <cagney@redhat.com>
 
        * user-regs.c (struct user_reg): Add "next" link.
@@ -21,7 +26,7 @@
 
 2003-07-30  Michael Snyder  <msnyder@redhat.com>
 
-       * structs.h (value_being_returned): Add a struct_addr argument.
+       * value.h (value_being_returned): Add a struct_addr argument.
        * infcall.c (call_function_by_hand): Pass struct_addr to 
        value_being_returned.
        * infcmd.c (print_return_value): Pass zero as struct_addr.
index b00785c119af003915f67c0ee9459ad9c86a6f79..4fd97ae5652d97822f2aaa144063c3b3cb184ae6 100644 (file)
@@ -1056,10 +1056,8 @@ the function call).", name);
     }
   else
     {
-      struct value *retval = value_being_returned (value_type,
-                                                  retbuf,
-                                                  struct_return,
-                                                  struct_addr);
+      struct value *retval = value_being_returned (value_type, retbuf,
+                                                  struct_return);
       do_cleanups (retbuf_cleanup);
       return retval;
     }
index c47c9eac876d55116ecd8f9fd748b7623ed1c5b0..df7d9508ccac0754e0acba5bc4e600b5808639c5 100644 (file)
@@ -1077,11 +1077,10 @@ print_return_value (int structure_return, struct type *value_type)
 
   if (!structure_return)
     {
-      value = value_being_returned (value_type, stop_registers, 0, 0);
+      value = value_being_returned (value_type, stop_registers, structure_return);
       stb = ui_out_stream_new (uiout);
       ui_out_text (uiout, "Value returned is ");
-      ui_out_field_fmt (uiout, "gdb-result-var", "$%d", 
-                       record_latest_value (value));
+      ui_out_field_fmt (uiout, "gdb-result-var", "$%d", record_latest_value (value));
       ui_out_text (uiout, " = ");
       value_print (value, stb->stream, 0, Val_no_prettyprint);
       ui_out_field_stream (uiout, "return-value", stb);
@@ -1089,23 +1088,20 @@ print_return_value (int structure_return, struct type *value_type)
     }
   else
     {
+      /* We cannot determine the contents of the structure because
+        it is on the stack, and we don't know where, since we did not
+        initiate the call, as opposed to the call_function_by_hand case */
 #ifdef VALUE_RETURNED_FROM_STACK
-      /* We cannot determine the contents of the structure because it
-        is on the stack, and we don't know where, since we did not
-        initiate the call, as opposed to the call_function_by_hand
-        case.  */
       value = 0;
       ui_out_text (uiout, "Value returned has type: ");
       ui_out_field_string (uiout, "return-type", TYPE_NAME (value_type));
       ui_out_text (uiout, ".");
       ui_out_text (uiout, " Cannot determine contents\n");
 #else
-      value = value_being_returned (value_type, stop_registers, 
-                                   structure_return, 0);
+      value = value_being_returned (value_type, stop_registers, structure_return);
       stb = ui_out_stream_new (uiout);
       ui_out_text (uiout, "Value returned is ");
-      ui_out_field_fmt (uiout, "gdb-result-var", "$%d", 
-                       record_latest_value (value));
+      ui_out_field_fmt (uiout, "gdb-result-var", "$%d", record_latest_value (value));
       ui_out_text (uiout, " = ");
       value_print (value, stb->stream, 0, Val_no_prettyprint);
       ui_out_field_stream (uiout, "return-value", stb);
index 77d9d3955f8c4f88c83840d3b3b8f81bc5de2ca9..d50626edf173b372cb12f52e4744821341be8c16 100644 (file)
@@ -420,8 +420,7 @@ extern struct value *value_subscript (struct value *array, struct value *idx);
 
 extern struct value *value_being_returned (struct type *valtype,
                                           struct regcache *retbuf,
-                                          int struct_return,
-                                          CORE_ADDR struct_addr);
+                                          int struct_return);
 
 extern struct value *value_in (struct value *element, struct value *set);
 
index 7e7e9b15534093678a60eac24b60c31d95c93e04..42395c886e2b4cf38b68f62468a87ed9a6308edd 100644 (file)
@@ -1212,36 +1212,31 @@ value_from_double (struct type *type, DOUBLEST num)
 /* ARGSUSED */
 struct value *
 value_being_returned (struct type *valtype, struct regcache *retbuf,
-                     int struct_return, CORE_ADDR struct_addr)
+                     int struct_return)
 {
   struct value *val;
   CORE_ADDR addr;
 
-  if (struct_return)
-    {
-      if (struct_addr != 0)
-       {
-         /* Struct return addr supplied by hand_function_call.  */
-         return value_at (valtype, struct_addr, NULL);
-       }
-      /* If one of these is not defined, just use EXTRACT_RETURN_VALUE
-        instead.  */
-      else if (EXTRACT_STRUCT_VALUE_ADDRESS_P ())
-       {
-         addr = EXTRACT_STRUCT_VALUE_ADDRESS (retbuf);
-         if (!addr)
-           error ("Function return value unknown.");
-         return value_at (valtype, addr, NULL);
-       }
-      else if (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ())
-       {
-         char *buf = deprecated_grub_regcache_for_registers (retbuf);
-         addr = DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (buf);
-         if (!addr)
-           error ("Function return value unknown.");
-         return value_at (valtype, addr, NULL);
-       }
-    }
+  /* If this is not defined, just use EXTRACT_RETURN_VALUE instead.  */
+  if (EXTRACT_STRUCT_VALUE_ADDRESS_P ())
+    if (struct_return)
+      {
+       addr = EXTRACT_STRUCT_VALUE_ADDRESS (retbuf);
+       if (!addr)
+         error ("Function return value unknown.");
+       return value_at (valtype, addr, NULL);
+      }
+
+  /* If this is not defined, just use EXTRACT_RETURN_VALUE instead.  */
+  if (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ())
+    if (struct_return)
+      {
+       char *buf = deprecated_grub_regcache_for_registers (retbuf);
+       addr = DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (buf);
+       if (!addr)
+         error ("Function return value unknown.");
+       return value_at (valtype, addr, NULL);
+      }
 
   val = allocate_value (valtype);
   CHECK_TYPEDEF (valtype);