From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 1D794383129B for ; Mon, 27 Jun 2022 15:14:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1D794383129B Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25REwNRo010185 for ; Mon, 27 Jun 2022 15:14:09 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3gyesaghqu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 27 Jun 2022 15:14:09 +0000 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 25REwxjw011809 for ; Mon, 27 Jun 2022 15:14:08 GMT Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3gyesaghqc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Jun 2022 15:14:08 +0000 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 25RF5pPP009232; Mon, 27 Jun 2022 15:14:07 GMT Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by ppma03wdc.us.ibm.com with ESMTP id 3gwt096yfb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Jun 2022 15:14:07 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 25RFE6L038732164 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Jun 2022 15:14:06 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9C7A9AC059; Mon, 27 Jun 2022 15:14:06 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 22059AC05E; Mon, 27 Jun 2022 15:14:06 +0000 (GMT) Received: from li-e362e14c-2378-11b2-a85c-87d605f3c641.ibm.com (unknown [9.211.68.56]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 27 Jun 2022 15:14:06 +0000 (GMT) Message-ID: <3f116734745ecd168d45584c0686b0eca3406eb4.camel@us.ibm.com> From: Carl Love To: Andrew Burgess , Carl Love via Gdb-patches , will schmidt , Ulrich Weigand Date: Mon, 27 Jun 2022 08:14:05 -0700 In-Reply-To: <87letidy26.fsf@redhat.com> References: <8338e122e114bb9091f2f06cd0012db826ece6cb.camel@us.ibm.com> <87letidy26.fsf@redhat.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) X-TM-AS-GCONF: 00 X-Proofpoint-GUID: QmYtSMAZxwGuWCBVscPp1QFzGJVQHrmv X-Proofpoint-ORIG-GUID: gn1B5CY5bKlVdTNs1upjkYej8U6dpfXW Content-Transfer-Encoding: 7bit X-Proofpoint-UnRewURL: 1 URL was un-rewritten MIME-Version: 1.0 Subject: RE: [PATCH] Fix for gdb.base/break-idempotent.exp X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-06-27_06,2022-06-24_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 mlxlogscore=999 phishscore=0 impostorscore=0 priorityscore=1501 adultscore=0 lowpriorityscore=0 mlxscore=0 bulkscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206270065 X-Spam-Status: No, score=-12.0 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, 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.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2022 15:14:11 -0000 Andrew: Thanks for looking at the patch. I am fine with you using your patch and merging in anything from mine that is useful. Thanks for sharing you insight on the issues. Thanks for the help in getting this fixed. Take care. Carl On Mon, 2022-06-27 at 14:40 +0100, Andrew Burgess wrote: > Hi Carl, > > First, an apology, I posted this patch: > > > https://sourceware.org/pipermail/gdb-patches/2022-June/190257.html > > > without first checking the mailing list, so I missed that you had > already posted this. > > You'll see that our fixes are pretty similar. Given you posted this > first, I'm happy for you to merge your patch, however, I do have some > feedback... > > Carl Love via Gdb-patches writes: > > > GDB maintainers: > > > > The gdb.base/break-idempotent.exp test generates errors trying to > > set > > and remove breakpoints. The issue is gdb is trying to set and > > remove > > breakpoints in skip_hw_watchpoint_tests not in break-idempotent. > > I'm not sure I agree with this. What I saw was problems when > delete_breakpoints was called from break-idempotent.exp AFTER the > skip_hw_watchpoint_tests call has caused GDB to exit. > > > T > > he > > issue is the skip_hw_watchpoint_test restarts gdb on the test hw > > watchpoint test binary after gdb has been started for the break- > > idempotent.exp test messing up the test. > > It's the fact that GDB is exited at the end of has_hw_wp_support that > causes the immediate problem. Of couse, if we changed > has_hw_wp_support > so that GDB was left running then the restart would become the > problem... > > > This patch moves the check for hardware breakpoints before running > > the > > break-idempotent tests. The move also improves the performance as > > the > > skip_hw_watchpoint_test only needs to be run once rather for each > > test > > case. > > The has_hw_wp_support check is cached, so there's no (significant) > performance improvement; has_hw_wp_support is only ever called once. > The key to the fix is thta skip_hw_watchpoint_tests, and hence > has_hw_wp_support is now called before GDB is started as part of the > main test. > > > The patch has been tested on Power 10 and fixes the failures seen > > on > > PowerPC. > > > > Please let me know if this patch is acceptable for mainline. > > Carl Love > > > > > > ------------------------------------------------- > > Fix for gdb.base/break-idempotent.exp > > > > --- > > gdb/testsuite/gdb.base/break-idempotent.exp | 12 +++++++++++- > > 1 file changed, 11 insertions(+), 1 deletion(-) > > > > diff --git a/gdb/testsuite/gdb.base/break-idempotent.exp > > b/gdb/testsuite/gdb.base/break-idempotent.exp > > index 29002f103a8..38b7632a7fc 100644 > > --- a/gdb/testsuite/gdb.base/break-idempotent.exp > > +++ b/gdb/testsuite/gdb.base/break-idempotent.exp > > @@ -145,6 +145,16 @@ proc test_break { always_inserted > > break_command } { > > } > > } > > > > +# The skip_hw_watchpoint_tests generates a small test source file > > to test if HW > > +# watchpoints are supported. Do not want the compile and test for > > the skip > > +# hw watchpoint to restart gdb after the break-idempotemt test has > > is started > > +# on gdb. Do the skip_hw_watchpoint_tests first. > > How about this updated comment? > > # The skip_hw_watchpoint_tests starts GDB on a small test program > to > # check if HW watchpoints are supported. We do not want to restart > # GDB after this test script has itself started GDB, so call > # skip_hw_watchpoint_tests first. > > > +if {[skip_hw_watchpoint_tests]} { > > + set skip_hw_wp 1 > > +} else { > > + set skip_hw_wp 0 > > +} > > In my patch I wrote something similar, but, mentioned that > skip_hw_watchpoint_tests caches its result, so just called > skip_hw_watchpoint_tests without changing anything else. > > If you prefer your version, then that's fine, but please use > true/false > instead of 1/0 when setting skip_hw_wp. > > Thanks, > Andrew > > > + > > # The testcase uses the "file" command to force breakpoint re-set > > in > > # GDB. Test both with and without PIE, as GDB used to mishandle > > # breakpoint re-set when reloading PIEs. > > @@ -174,7 +184,7 @@ foreach_with_prefix pie { "nopie" "pie" } { > > test_break $always_inserted "hbreak" > > } > > > > - if {![skip_hw_watchpoint_tests]} { > > + if {!$skip_hw_wp} { > > test_break $always_inserted "watch" > > } > > > > -- > > 2.31.1