From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 0D2823858C50 for ; Tue, 27 Sep 2022 16:14:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0D2823858C50 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28RGAcFg014333 for ; Tue, 27 Sep 2022 16:14:36 GMT Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3jv2155t4n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 27 Sep 2022 16:14:36 +0000 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 28RG5BVn028505 for ; Tue, 27 Sep 2022 16:14:35 GMT Received: from b03cxnp07027.gho.boulder.ibm.com (b03cxnp07027.gho.boulder.ibm.com [9.17.130.14]) by ppma05wdc.us.ibm.com with ESMTP id 3jssh9njys-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 27 Sep 2022 16:14: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 28RGEY4b56099222 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Sep 2022 16:14:34 GMT Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7F59F58062; Tue, 27 Sep 2022 16:14:34 +0000 (GMT) Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CA4C458066; Tue, 27 Sep 2022 16:14:33 +0000 (GMT) Received: from sig-9-65-248-8.ibm.com (unknown [9.65.248.8]) by smtpav04.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 27 Sep 2022 16:14:33 +0000 (GMT) Message-ID: Subject: [PATCH] Fix test next-reverse-bkpt-over-sr.exp From: Carl Love To: "gdb-patches@sourceware.org" Cc: Ulrich Weigand , Will Schmidt , cel@us.ibm.com Date: Tue, 27 Sep 2022 09:14:33 -0700 Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: y3sYcWsHzKKpcgnNl0Cxf3247PgY9OW8 X-Proofpoint-ORIG-GUID: y3sYcWsHzKKpcgnNl0Cxf3247PgY9OW8 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-27_07,2022-09-27_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 mlxscore=0 mlxlogscore=644 malwarescore=0 spamscore=0 suspectscore=0 priorityscore=1501 adultscore=0 clxscore=1015 lowpriorityscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209270099 X-Spam-Status: No, score=-11.3 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-List-Received-Date: Tue, 27 Sep 2022 16:14:38 -0000 GDB maintainers: The next-reverse-bkpt-over-sr.exp test sets a breakpoint on *callee. The intention is the test is setting a breakpoint on the entry point of the function. However on PowerPC, the statement sets the breakpoint on the global entry point. The test uses the local entry point to the function callee and thus the breakpoint on the global entry point is never hit resulting in the test failing. This patch changes the break instruction to callee to properly set the breakpoint. The patch has been tested on both Power10 and X86-64 with no regression errors. Please let me know if this patch is acceptable for mainline. Thanks. Carl Love --------------------------------------------------------------- Fix test next-reverse-bkpt-over-sr.exp The test suses a gdb_test to set a breakpoint at *callee. The message says "set breakpoint at callee's entry". The statement b *callee will set a breakpoint on the first instruction of the function. On some architectres, that may be the function entry point. The PowerPC ABI specifies both local and global entry points. The statement b *callee sets the breakpoint t the global entry point and b callee sets the breakpoint at the beginning of the fucntion, i.e. after the local entry point and prolog. The local entry point is generally used. The global entry point is only used if the TOC needs to be stup. int callee() { /* ENTER CALLEE */ 100007ac: 02 10 40 3c lis r2,4098 <- global entry point 100007b0: 00 7f 42 38 addi r2,r2,32512 100007b4: f8 ff e1 fb std r31,-8(r1) <- local entry point 100007b8: d1 ff 21 f8 stdu r1,-48(r1) <- prolog 100007bc: 78 0b 3f 7c mr r31,r1 <- prolog return myglob++; /* ARRIVED IN CALLEE */ 100007c0: 00 00 00 60 nop <- location b callee 100007c4: 40 81 22 39 addi r9,r2,-32448 100007c8: 00 00 29 81 lwz r9,0(r9) 100007cc: 01 00 09 39 addi r8,r9,1 ... The test should break on callee, not *callee, to get the desired behaviour on PowerPC as well as other architecturs like X86-64. This patch has been tested on Poser PC and X86-64 without any regression failures. --- gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp b/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp index 6ef56d30e7b..4e163c5c2f8 100644 --- a/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp +++ b/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp @@ -45,7 +45,7 @@ if [supports_process_record] { set lineno [gdb_get_line_number "STEP INTO THIS CALL"] gdb_test "advance $lineno" ".*STEP INTO THIS CALL.*" "get past callee call" -gdb_test "b \*callee" "" "set breakpoint at callee's entry" +gdb_test "b callee" "" "set breakpoint at callee's entry" set bpnum [get_integer_valueof "\$bpnum" 0] gdb_test "reverse-next" \ -- 2.37.2