From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1983) id 72DAE382E21B; Thu, 17 Nov 2022 16:40:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 72DAE382E21B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668703220; bh=gqrftoAx+Z1axGK53voPA6/1QndJfgz1AWt95OGoUSo=; h=From:To:Subject:Date:From; b=ajeEHIx/lkwt2ulkGi4nPqoEuEiS/zaQRDIKaGqMNT/F7WxgG3UK0LoyjtwheRygx 9acLSaPQNDdJjH4eayDQjU4ypM0NCZcGik8HEjeHaD/n29IhipMhwIjJQA+k/UnU1U Llv6SeVwedbr9v5io9AuhYPtplZxn1ZLvZ28q0qI= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Carl Love To: gdb-cvs@sourceware.org Subject: [binutils-gdb] PowerPC, fix gdb.base/retval-large-struct.exp X-Act-Checkin: binutils-gdb X-Git-Author: Carl Love X-Git-Refname: refs/heads/master X-Git-Oldrev: 2f6831b8066cd758e2f39c38503d2fa41608b9a7 X-Git-Newrev: f68eca29d3b3e551a45a1bb02b05a0b3a4856f59 Message-Id: <20221117164020.72DAE382E21B@sourceware.org> Date: Thu, 17 Nov 2022 16:40:20 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Df68eca29d3b3= e551a45a1bb02b05a0b3a4856f59 commit f68eca29d3b3e551a45a1bb02b05a0b3a4856f59 Author: Carl Love Date: Wed Nov 16 16:12:02 2022 -0600 PowerPC, fix gdb.base/retval-large-struct.exp =20 Support for printining non-trivial return values was recently added in commit: =20 commit a0eda3df5b750ae32576a9be092b361281a41787 Author: Carl Love Date: Mon Nov 14 16:22:37 2022 -0500 =20 PowerPC, fix support for printing the function return value for non= -trivial values. =20 The functionality can now be used to fix gdb.base/retval-large-struct.e= xp. The test just needs to be compiled with -fvar-tracking to enable GDB to determine the address off the return buffer when the function is called. =20 The current output from the test: =20 34 return big_struct; (gdb) PASS: gdb.base/retval-large-struct.exp: continue to breakpoint: B= reak in print_large_struct finish warning: Cannot determine the function return value. Try compiling with -fvar-tracking. Run till exit from #0 return_large_struct () at binutils-gdb-current/g= db/testsuite/gdb.base/retval-large-struct.c:34 main (argc=3D1, argv=3D0x7fffffffcd58) at binutils-gdb-current/gdb/test= suite/gdb.base/retval-large-struct.c:44 44 return 0; Value returned has type: struct big_struct_t. Cannot determine contents (gdb) FAIL: gdb.base/retval-large-struct.exp: finish from return_large_= struct testcase binutils-gdb-current/gdb/testsuite/gdb.base/retval-large-struc= t.exp completed in 1 seconds =20 This patch adds the command line argument -fvar-tracking to enable gdb = to determine the return vaule and thus fixing the test. =20 Patch tested on Power 10 with no regressions. Diff: --- gdb/testsuite/gdb.base/retval-large-struct.exp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.base/retval-large-struct.exp b/gdb/testsuite= /gdb.base/retval-large-struct.exp index 11bc4d5fbdf..f7aa1df81fa 100644 --- a/gdb/testsuite/gdb.base/retval-large-struct.exp +++ b/gdb/testsuite/gdb.base/retval-large-struct.exp @@ -20,7 +20,13 @@ =20 standard_testfile =20 -if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { +set additional_flags "" + +if {[have_fvar_tracking]} { + set additional_flags "additional_flags=3D -fvar-tracking" +} + +if {[prepare_for_testing "failed to prepare" $testfile $srcfile [list debu= g $additional_flags]]} { return -1 }