From patchwork Wed Nov 16 22:11:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Love X-Patchwork-Id: 60723 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C2D80396E03A for ; Wed, 16 Nov 2022 22:12:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C2D80396E03A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668636725; bh=8KJ7rv+YGXjeRK3QlF9Lg2DCv4fCB2gKvUMmXWgdr2Y=; h=Subject:To:Cc:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=TwTsN2hrgzEEJL9VT/BlVjXQQDqP8WEUkOVfawbXHX2wn46VgArkKKED3noNveAd+ fELZIK/iXq2VMO2w8+xRpCJksG80mESgEYmZTqf9Qqo2BKwCimdO1DzYrttFHaAk4y Upp/qnrwlMoRTqTwRtNZi+FyXsy+yQuhGt5J/4/Y= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 15C77396E025 for ; Wed, 16 Nov 2022 22:11:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 15C77396E025 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AGLXueM015194 for ; Wed, 16 Nov 2022 22:11:37 GMT Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3kw7w010mm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 16 Nov 2022 22:11:36 +0000 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2AGM5P0e000918 for ; Wed, 16 Nov 2022 22:11:35 GMT Received: from b03cxnp07027.gho.boulder.ibm.com (b03cxnp07027.gho.boulder.ibm.com [9.17.130.14]) by ppma04dal.us.ibm.com with ESMTP id 3kt34a4hdx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 16 Nov 2022 22:11:35 +0000 Received: from smtpav04.dal12v.mail.ibm.com ([9.208.128.131]) by b03cxnp07027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2AGMBYgM35652286 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Nov 2022 22:11:34 GMT Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4D7CF58052; Wed, 16 Nov 2022 22:11:34 +0000 (GMT) Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E04BF5804E; Wed, 16 Nov 2022 22:11:33 +0000 (GMT) Received: from li-e362e14c-2378-11b2-a85c-87d605f3c641.ibm.com (unknown [9.163.52.7]) by smtpav04.dal12v.mail.ibm.com (Postfix) with ESMTP; Wed, 16 Nov 2022 22:11:33 +0000 (GMT) Message-ID: <71926c391f43cee2051ea0c9b449ec0aecc847ec.camel@us.ibm.com> Subject: [PATCH] PowerPC, fix gdb.base/retval-large-struct.exp To: "gdb-patches@sourceware.org" Cc: cel@us.ibm.com, Ulrich Weigand , Will Schmidt Date: Wed, 16 Nov 2022 14:11:33 -0800 X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) Mime-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Vdju_2ih7aVUpvqaIwOQUmh4nR2Jr8XP X-Proofpoint-ORIG-GUID: Vdju_2ih7aVUpvqaIwOQUmh4nR2Jr8XP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-16_03,2022-11-16_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 suspectscore=0 malwarescore=0 priorityscore=1501 mlxlogscore=902 lowpriorityscore=0 mlxscore=0 clxscore=1015 adultscore=0 phishscore=0 impostorscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211160151 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Carl Love via Gdb-patches From: Carl Love Reply-To: Carl Love Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" GDB maintainers: Currently the test gdb.base/retval-large-struct.exp is not able to access the return buffer address for the data being returned by the function. The functionality needed to obtain the value of r3 which holds the return buffer address on entry to the function was recently added in a new gdb method. This new method can be used by this test to allow it to correctly access the data being returned by the function. This patch adds the needed command line argument to the test compile line thus allowing GDB to access the data via the return buffer address stored in register r3. The patch has been tested on Power 10 with no additional regressions. Please let me know if this patch is acceptable. Thanks. Carl ----------------------------------- PowerPC, fix gdb.base/retval-large-struct.exp Support for printining non-trivial return values was recently added in commit: commit a0eda3df5b750ae32576a9be092b361281a41787 Author: Carl Love Date: Mon Nov 14 16:22:37 2022 -0500 PowerPC, fix support for printing the function return value for non-trivial values. The functionality can no be used by test fix gdb.base/retval-large-struct.exp. The test just needs to be compiled with -fvar-tracking to enable GDB to determine the address off the return buffere when the function is called. The current output from the test: 34 return big_struct; (gdb) PASS: gdb.base/retval-large-struct.exp: continue to breakpoint: Break 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/gdb/testsuite/gdb.base/retval-large-struct.c:34 main (argc=1, argv=0x7fffffffcd58) at binutils-gdb-current/gdb/testsuite/gdb.base/retval-large-struct.c:44 44 return 0;^M 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-struct.exp completed in 1 seconds This patch adds the command line argument -fvar-tracking to enable gdb to determine the return vaule and thus fixing the test. Patch tested on Power 10 with no regressions. --- 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 @@ standard_testfile -if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { +set additional_flags "" + +if {[have_fvar_tracking]} { + set additional_flags "additional_flags= -fvar-tracking" +} + +if {[prepare_for_testing "failed to prepare" $testfile $srcfile [list debug $additional_flags]]} { return -1 }