From patchwork Thu Nov 16 22:10:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Love X-Patchwork-Id: 80078 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 560853858436 for ; Thu, 16 Nov 2023 22:10:24 +0000 (GMT) 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 C18C23858D33 for ; Thu, 16 Nov 2023 22:10:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C18C23858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C18C23858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700172612; cv=none; b=taksJLSyyCFgs8UsREAcpagibW/kXNxPNIVG6gW6W2hzyZ5hL122WerBa3BvWMnM774cO4wc7MVsuId+n8ZghiC94OwFoAHVe5RV6Jf3qfOfyZeR9paAD8M5PiLrSCQRKu8NYmU+XdWaR/IjBpU25LOhWL5ZDc6RYtdcDYP04wc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700172612; c=relaxed/simple; bh=GkU51uMTKeqg2/jK/StOvJiX72trrM3VuFvv3NPJOtE=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:Mime-Version; b=he5j0OjZLMLJeikmnH+10KkgMwoyRwxSgo8fWhkRKxdM0hSh8V6I9Z42GF2xRvZSW8v6bQdkUoMNz8zHl/+TwOKYnxgMLhCZqRie3c7N1SvCyJ7IB/gPvroTsINiEIkXuYY11JaiM6ZfQR445FFJc3rOyD+DCzsu11pekXQe+II= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353726.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AGM2Dvv014651; Thu, 16 Nov 2023 22:10:06 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : content-type : mime-version : content-transfer-encoding; s=pp1; bh=8CYfh0lzz4ldoC/dHvzDYB9zbwAffxh36MfYvHLgFD4=; b=MBP/OyRjW/Dk2OQaOKKDRfBwW8EE8kba4Tc/35oGcS3dVSX0lPJR1k+L7Fqb/LjPMoFe yBd8AZV+/2BTsQLx9m4l5Cth8ldC646/Ml5belu8p79r0k1Y1KWm1AwmIRD+0X5jjSeK PIpfPtmMTbouUpmWVOGHN/01qWZWw5TTv6gK1XZKZCAmBvsET5Cq0iaE75kkdjpc2zUb 8fb6Is/LZjxusfpINniGrL7SMyV9zxUG9yE3hFIJGXmLlvLmxKaJTqeI/q7khelw0hdy QP4ON1PP8/VVrDTjMiOhaRusIHjhlx0mA/58Nw++qXMQYHw680G/piNM3cgcfBlKnf78 RA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3uduh5g8j5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Nov 2023 22:10:05 +0000 Received: from m0353726.ppops.net (m0353726.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3AGM9oem018779; Thu, 16 Nov 2023 22:10:05 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3uduh5g8fb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Nov 2023 22:10:05 +0000 Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3AGL0cIo023134; Thu, 16 Nov 2023 22:10:04 GMT Received: from smtprelay05.dal12v.mail.ibm.com ([172.16.1.7]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3uakxta2q9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Nov 2023 22:10:04 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay05.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3AGMA48w38339056 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Nov 2023 22:10:04 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DBC3B58059; Thu, 16 Nov 2023 22:10:03 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9DB0258043; Thu, 16 Nov 2023 22:10:02 +0000 (GMT) Received: from wecm-9-67-110-146.wecm.ibm.com (unknown [9.67.110.146]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Thu, 16 Nov 2023 22:10:02 +0000 (GMT) Message-ID: <208227c23637af9092d488399f5c197c21f742cb.camel@linux.ibm.com> Subject: [PATCH] PowerPC: Fix test gdb.ada/finish-large.exp From: Carl Love To: Luis Machado , Tom Tromey , gdb-patches@sourceware.org, keiths@redhat.com Cc: cel@linux.ibm.com Date: Thu, 16 Nov 2023 14:10:01 -0800 X-Mailer: Evolution 3.28.5 (3.28.5-22.el8) Mime-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: qFp0dT_uQKP7Hz_UCB2eM5OiCfVIkWXT X-Proofpoint-ORIG-GUID: S2LK42YAbdLu51b4-6JNfgNia6V8bCM8 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-16_23,2023-11-16_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 mlxlogscore=999 clxscore=1015 mlxscore=0 impostorscore=0 phishscore=0 bulkscore=0 adultscore=0 priorityscore=1501 suspectscore=0 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311160172 X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org GDB maintainers: The following patch fixes a single regression error in test gdb.ada/finish-large.exp on the PowerPC platform. The patch compiles the test with the -fvar-tracking command line option enabled so the DWARF DW_TAG_call_site information will be included in the binary. This DWARF information is used by PowerPC to obtain the value of r3 on entry to a function. The address to return a structure is passed into a function in r3. But r3 is not guaranteed to be the same at the end of the function when the finish command prints the function return value. With -fvar-tracking enabled, GDB can now print the return value of a function returning a large structure on the PowerPC platform. The patch has been tested on Power 10 and X86-64 with no regression errors. Please let me know if this patch is acceptable for mainline. Thanks. Thanks to Luis, Tom and Keith for their help. Carl ------------------------------------ PowerPC: Fix test gdb.ada/finish-large.exp Function Create_large returns a large data structure. On PowerPC, register r3 contains the address of where the data structure to be returned is to be stored. However, on exit the ABI does not guarantee that r3 has not been changed. The GDB finish command prints the return value of the function at the end of the function. GDB needs to use the DW_TAG_call_site information to determine the value of r3 on entry to the function to correctly print the return value at the end of the function. The test must be compiled with -fvar-tracking for the DW_TAG_call_site information to be included in the executable file. This patch adds the -fvar-tracking option to the compile line if the option is supported. The patch fixes the one regression error for the test on PowerPC. The patch has been tested on Power 10 and X86-64 with no regressions. --- gdb/testsuite/gdb.ada/finish-large.exp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.ada/finish-large.exp b/gdb/testsuite/gdb.ada/finish-large.exp index 5661d132a18..6c8b1b2648d 100644 --- a/gdb/testsuite/gdb.ada/finish-large.exp +++ b/gdb/testsuite/gdb.ada/finish-large.exp @@ -19,7 +19,13 @@ require allow_ada_tests standard_ada_testfile p -if {[gdb_compile_ada "${srcfile}" "${binfile}" executable debug] != ""} { +set flags {debug} + +if {[have_fvar_tracking]} { + lappend flags "additional_flags=-fvar-tracking" +} + +if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $flags] != ""} { return -1 }