From 3360bae61faee3b57e4defa33cd7387be5c0dea8 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 7 Sep 2022 14:01:13 -0600 Subject: [PATCH] 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. --- gdb/infcall.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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 { -- 2.30.2