From: Tom Tromey Date: Wed, 7 Sep 2022 20:01:13 +0000 (-0600) Subject: Use value_at_non_lval in get_call_return_value X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3360bae61faee3b57e4defa33cd7387be5c0dea8;p=binutils-gdb.git Use value_at_non_lval in get_call_return_value get_call_return_value can handle RETURN_VALUE_STRUCT_CONVENTION, because the call is completely managed by gdb. However, it does not handle variably-sized types correctly. The simplest way to fix this is to use value_at_non_lval, which does type resolution. --- diff --git a/gdb/infcall.c b/gdb/infcall.c index acaaf0c029d..e09904f9a35 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -476,12 +476,7 @@ 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 {