From patchwork Tue Mar 7 20:24:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Love X-Patchwork-Id: 66097 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 9C2B938555B6 for ; Tue, 7 Mar 2023 20:25:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9C2B938555B6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678220712; bh=m2etomFh673dRTwZeDDw95ERR1OizLMQ2/ybsGo9EJM=; h=Subject:To:Cc:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=GLxki36YxA11HjvOityWBayAwRui5meV8rIqX+YG97sqFRFq18jlxoC7poVkjZOt5 HXqskuyyspn3TkwBwjvrrATHy00z6l1UfD8vkuNKpp+iTR+XYlBM5DaAXvLL13R8kO 4sgG/9VuditFsfs2S9TQtp+r63/SkrUvA2f9d/ns= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 81DC23858C2C for ; Tue, 7 Mar 2023 20:24:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 81DC23858C2C Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 327HokED020180 for ; Tue, 7 Mar 2023 20:24:46 GMT Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3p686a6s8y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 07 Mar 2023 20:24:45 +0000 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 327KCB2N015392 for ; Tue, 7 Mar 2023 20:24:45 GMT Received: from smtprelay03.wdc07v.mail.ibm.com ([9.208.129.113]) by ppma02dal.us.ibm.com (PPS) with ESMTPS id 3p4199tek7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 07 Mar 2023 20:24:45 +0000 Received: from smtpav05.dal12v.mail.ibm.com (smtpav05.dal12v.mail.ibm.com [10.241.53.104]) by smtprelay03.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 327KOgsO22545042 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 7 Mar 2023 20:24:42 GMT Received: from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 661A958052; Tue, 7 Mar 2023 20:24:42 +0000 (GMT) Received: from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1400158069; Tue, 7 Mar 2023 20:24:42 +0000 (GMT) Received: from li-e362e14c-2378-11b2-a85c-87d605f3c641.ibm.com (unknown [9.163.92.223]) by smtpav05.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 7 Mar 2023 20:24:41 +0000 (GMT) Message-ID: <3201f8986b24647fdf1492d83354b869a207ad97.camel@us.ibm.com> Subject: [PATCH] PowerPC, fix test gdb.arch/altivec-regs.exp To: gdb-patches@sourceware.org, Ulrich Weigand Cc: cel@us.ibm.com Date: Tue, 07 Mar 2023 12:24:41 -0800 X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) Mime-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: Vd823TMzYGnCp1eXdZ9iwkznnDZBuVgT X-Proofpoint-GUID: Vd823TMzYGnCp1eXdZ9iwkznnDZBuVgT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-07_15,2023-03-07_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 impostorscore=0 adultscore=0 mlxscore=0 mlxlogscore=580 phishscore=0 priorityscore=1501 spamscore=0 suspectscore=0 lowpriorityscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303070174 X-Spam-Status: No, score=-11.8 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: The following patch fixes test gdb.arch/altivec-regs.exp. The issue is the test sets a breakpoint on the line that it is currently stopped at and then does a continue to get to the same line to start the test. The test assumes GDB will stop at the breakpoint it just set. However, GDB runs to the end of the program. The test is fixed by initializing a local variable so GDB will stop on the variable initialization. GDB then sets and runs to the breakpoint where the test starts. The issue only seems to occur with some distros, specifically with RHEL9. The patch fixes the test so it runs correctly on RHEL 9. Please let me know if this patch is acceptable for mainline. Thanks. Carl ---------------------------------------------------------- PowerPC, fix test gdb.arch/altivec-regs.exp The test fails on Power 10 with the RHEL9 distro but passes on Ubuntu 22.04. The test set a the breakpoint in main that stops at line: a = 9; /* start here */. The test then sets a break point at the same line where it wants to start the test and does a continue. GDB does not stop again on the same line where it is stopped, but rather continues to the end of the program. Initialize variable A to zero so the break on main will stop before setting a break point on line a = 9; /* start here */. Make the match on the breakpoint number generic. Patch has been tested on Power 10 with RHEL 9, Power 10 with Ubuntu 22.04, and Power 9 with Fedora 36 with no regression failures. --- gdb/testsuite/gdb.arch/altivec-regs.c | 2 +- gdb/testsuite/gdb.arch/altivec-regs.exp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.arch/altivec-regs.c b/gdb/testsuite/gdb.arch/altivec-regs.c index 1411f15e358..a838b28b9b5 100644 --- a/gdb/testsuite/gdb.arch/altivec-regs.c +++ b/gdb/testsuite/gdb.arch/altivec-regs.c @@ -18,7 +18,7 @@ main () vector unsigned int y; vector unsigned int x; vector unsigned int z; - int a; + int a = 0; #ifdef _AIX /* On AIX, the debugger cannot access vector registers before they diff --git a/gdb/testsuite/gdb.arch/altivec-regs.exp b/gdb/testsuite/gdb.arch/altivec-regs.exp index b771a4df76f..ece207be48e 100644 --- a/gdb/testsuite/gdb.arch/altivec-regs.exp +++ b/gdb/testsuite/gdb.arch/altivec-regs.exp @@ -122,7 +122,7 @@ send_gdb "info vector\n" gdb_expect_list "info vector" ".*$gdb_prompt $" $pattern_list gdb_test "break vector_fun" \ - "Breakpoint 2 at.*altivec-regs.c, line \[0-9\]+\\." \ + "Breakpoint $decimal at.*altivec-regs.c, line \[0-9\]+\\." \ "set breakpoint at vector_fun" # Actually it is nuch easier to see these results printed in hex. @@ -131,7 +131,7 @@ gdb_test "set output-radix 16" \ "set output radix to hex" gdb_test "continue" \ - "Breakpoint 2, vector_fun .a=.0xfefefefe, 0xfefefefe, 0xfefefefe, 0xfefefefe., b=.0x1010101, 0x1010101, 0x1010101, 0x1010101.*altivec-regs.c.*vec_splat_u8.2..;" \ + "Breakpoint $decimal, vector_fun .a=.0xfefefefe, 0xfefefefe, 0xfefefefe, 0xfefefefe., b=.0x1010101, 0x1010101, 0x1010101, 0x1010101.*altivec-regs.c.*vec_splat_u8.2..;" \ "continue to vector_fun" # Do a next over the assignment to vector 'a'.