From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id C045D3858D3C; Tue, 3 Jan 2023 16:44:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C045D3858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1672764297; bh=ja0O23cIE2uPhOknRmU2Bs8tMzOfFSF3FSwL2V6na5U=; h=From:To:Subject:Date:From; b=Ij+xG+HJ8117YmDI/pfV0yQw5mJgVeOGH81fTRNVGdqMFCpmyXP7yZQJDRrBtxoi9 yw+62ZxGcw3MTx8D+NTiWWCg1/u9SxkP6QWiMJ5/QeykY/bjMbIEnnnHHI7ISb+EG/ gZQDsiSqRmGoyZR26FnORZLwT5b6F44+7aUBzVZs= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Use value_at_non_lval in get_call_return_value X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 911627e7b1bc682a18ac5a976eb33cd87d73578f X-Git-Newrev: 3360bae61faee3b57e4defa33cd7387be5c0dea8 Message-Id: <20230103164457.C045D3858D3C@sourceware.org> Date: Tue, 3 Jan 2023 16:44:57 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D3360bae61fae= e3b57e4defa33cd7387be5c0dea8 commit 3360bae61faee3b57e4defa33cd7387be5c0dea8 Author: Tom Tromey Date: Wed Sep 7 14:01:13 2022 -0600 Use value_at_non_lval in get_call_return_value =20 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: --- 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 *r= i) push_thread_stack_temporary (thr, retval); } else - { - retval =3D allocate_value (ri->value_type); - read_value_memory (retval, 0, 1, ri->struct_addr, - value_contents_raw (retval).data (), - ri->value_type->length ()); - } + retval =3D value_at_non_lval (ri->value_type, ri->struct_addr); } else {