Rename to allow_rust_tests
[binutils-gdb.git] / gdb / infcall.c
index 4d5780b6e30486385f12b5a5b05dde651ed49add..e09904f9a35088757d3643c8a2830828994ee80a 100644 (file)
@@ -476,19 +476,13 @@ get_call_return_value (struct call_return_meta_info *ri)
          push_thread_stack_temporary (thr, retval);
        }
       else
-       {
-         retval = allocate_value (ri->value_type);
-         read_value_memory (retval, 0, 1, ri->struct_addr,
-                            value_contents_raw (retval).data (),
-                            ri->value_type->length ());
-       }
+       retval = value_at_non_lval (ri->value_type, ri->struct_addr);
     }
   else
     {
-      retval = allocate_value (ri->value_type);
-      gdbarch_return_value (ri->gdbarch, ri->function, ri->value_type,
-                           get_current_regcache (),
-                           value_contents_raw (retval).data (), NULL);
+      gdbarch_return_value_as_value (ri->gdbarch, ri->function, ri->value_type,
+                                    get_current_regcache (),
+                                    &retval, NULL);
       if (stack_temporaries && class_or_union_p (ri->value_type))
        {
          /* Values of class type returned in registers are copied onto
@@ -848,6 +842,7 @@ call_function_by_hand_dummy (struct value *function,
   bool stack_temporaries = thread_stack_temporaries_enabled_p (call_thread.get ());
 
   frame = get_current_frame ();
+  frame.prepare_reinflate ();
   gdbarch = get_frame_arch (frame);
 
   if (!gdbarch_push_dummy_call_p (gdbarch))
@@ -863,6 +858,8 @@ call_function_by_hand_dummy (struct value *function,
             "target calling convention."),
           get_function_name (funaddr, name_buf, sizeof (name_buf)));
 
+  frame.reinflate ();
+
   if (values_type == NULL || values_type->is_stub ())
     values_type = default_return_type;
   if (values_type == NULL)