From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id dvxlCeu1S2VYegEAWB0awg (envelope-from ) for ; Wed, 08 Nov 2023 11:23:07 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=M0OpRfoT; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 178CC1E0C1; Wed, 8 Nov 2023 11:23:07 -0500 (EST) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 06B941E00F for ; Wed, 8 Nov 2023 11:23:05 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 889F83882164 for ; Wed, 8 Nov 2023 16:23:04 +0000 (GMT) Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id CD0B43882077 for ; Wed, 8 Nov 2023 16:22:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CD0B43882077 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 CD0B43882077 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699460573; cv=none; b=IEsOvfQfbJn94S8/ry6R+cf2vTcLOM1hkwzGi9YPu2gxY5e4kQPPbl4YhLmczNKa1J0WUMXp20w6CfSicxxZlQZbd8+NBweOtDQsKtsLNVXNue3w9hwLIRQsnG0GEQNQpS44ubHhOvuMT6wGWOWuBAzDDds7q7wp66bLxn9DA0I= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699460573; c=relaxed/simple; bh=19qPC3Kq7PTheMneuQXBrDjbUVBx1qd3BIB2JE3un04=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:Mime-Version; b=edhcV8nU8juullLZKe62rnRnCv/JyYo858itDnkB3178rr6rG7m//MlGLq8GLURIu7uzUkKKbp3jgmBb1VXvWvCxkBNvXbIJn46ujQ6r4PHb5yQ+vGX32pAi3lRQl977+fkL8pgN3Ma2abQXM4NXiqN0TBM/T98qiViCaw3aS08= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A8G0bDN010031; Wed, 8 Nov 2023 16:22:47 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=6WD/eAlumDcEktAD87V2Cw4wH9UqIYB4/VTYzP1hnYc=; b=M0OpRfoT9/QUIV99Rh+ScMdMWH4l5HtjsMGqGwKUPCHBiN5Fb/mU1mz7vqFyw4DLE71e +ggzoqp4X12KFVuyz8h7TITiP2D309cmtG8/JA99I0KjkUVuA03oVn8YuFeAAWcZrsVt vcXFw/0eqnyFQxxcN3GshDer4fkMaHa9yxhmHi1hPHUB6xkfL7N6f1+9VggWqZGsUnHb mnR6kA0jzdDYOP/aGUSFXgmAZVbYza0RxRCpCP+aXkmWN1zQtSF6wdrY44D+wOU0DxqP TAKYqDfBemAECRGoa9RF8DZerIZVN1g4j+bAQcwVs9C2y07tGZP3/Eg2uStJ46s48fd+ QA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3u8dfk143b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Nov 2023 16:22:47 +0000 Received: from m0353725.ppops.net (m0353725.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3A8G2eaY017486; Wed, 8 Nov 2023 16:22:46 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3u8dfk142t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Nov 2023 16:22:46 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3A8E5BCZ028348; Wed, 8 Nov 2023 16:22:46 GMT Received: from smtprelay03.wdc07v.mail.ibm.com ([172.16.1.70]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3u7w22dy64-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Nov 2023 16:22:46 +0000 Received: from smtpav03.wdc07v.mail.ibm.com (smtpav03.wdc07v.mail.ibm.com [10.39.53.230]) by smtprelay03.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3A8GMjxV63373580 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 Nov 2023 16:22:45 GMT Received: from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 699E158054; Wed, 8 Nov 2023 16:22:45 +0000 (GMT) Received: from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4C6775805A; Wed, 8 Nov 2023 16:22:44 +0000 (GMT) Received: from wecm-9-67-110-146.wecm.ibm.com (unknown [9.67.110.146]) by smtpav03.wdc07v.mail.ibm.com (Postfix) with ESMTP; Wed, 8 Nov 2023 16:22:44 +0000 (GMT) Message-ID: Subject: [PATCH ver 2] Fix the gdb.ada/inline-section-gc.exp test From: Carl Love To: Luis Machado , Carl Love , gdb-patches@sourceware.org, Tom Tromey Cc: Guinevere Larsen , Ulrich Weigand Date: Wed, 08 Nov 2023 08:22:43 -0800 Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-22.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: z2iapDzbgWj8PyxU6qFjI4E_Xxe34Hht X-Proofpoint-GUID: _pluEJzEwmWltk6MxWGPIWb2UD6Yro8o 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-08_04,2023-11-08_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 adultscore=0 suspectscore=0 impostorscore=0 malwarescore=0 bulkscore=0 priorityscore=1501 phishscore=0 spamscore=0 mlxlogscore=999 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311080134 X-Spam-Status: No, score=-11.2 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+public-inbox=simark.ca@sourceware.org GDB maintainers, Luis, Tom: Version 2, fixed the name of the test the patch fixes in the email. Mixed it up with another patch I am working on sorry about that. Here is the patch to fix test gdb.ada/inline-section-gc.exp on PowerPC as discussed on IRC. Per that discussion with Tom and Luis, the point of the test is to look for an error where a breakpoint in an inlined ada function was reported as being set in multiple places. There should only be one location reported for the test and the breakpoint address should not be at address 0x0. The test also fails on aarch64 but passes on X86-64. The issue is the location of the inserted breakpoint in function callee may be reported as being in file callee.adb or in file caller.adb. The location reported by the ada compiler for inlined functions seems to be a function of either the ada compiler version or target dependent. The following patch will accept the reported breakpoint location as being correctly set in either file callee.adb or caller.adb. In either case the address of the breakpoint must not be zero. The test checks that the file line number matches the requested line number in file calleeadb or one less if the reported location is in caller.adb. The key thing is we want to make sure we have a reasonable line number and the breakpoint address is not zero. The patch fixes the single test failure on PowerPC. It does not introduce any additional errors on the X86-84 platform on which it was tested. Please let me know if the patch looks OK for gdb mainline. Thanks. Carl ----------------------------------------- Fix the gdb.ada/inline-section-gc.exp test The original intention of the test appears to be checking to make sure setting a breakpoint in an inlined function didn't set multiple breakpoints where one of them was at address 0. The gdb.ada/inline-section-gc.exp test may pass or fail depending on the version of gnat. Per the discussion on IRC, the ada inlining appears to have some target dependencies. In this test there are two functions, callee and caller. Function calee is inlined into caller. The test sets a breakpoint in function callee. The reported location where the breakpoint is set may be at the requested location in callee or the location in caller after callee has been inlined. The test needs to accept either location as correct provided the breakpoint address is not zero. This patch checks to see if the reported breakpoint is in function callee or function caller and fails if the breakpoint address is 0x0. The line number where the breakpoint is set will match the requested line if the breakpoint location is reported is callee.adb. If the reported file is caller.adb, the line number is one less. The difference is a function of the source code. The key thing is the line number should be reasonable. This patch fixes the single regression failure for the test on PowerPC. It does not introduce any failures on X86-64. --- gdb/testsuite/gdb.ada/inline-section-gc.exp | 23 ++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.ada/inline-section-gc.exp b/gdb/testsuite/gdb.ada/inline-section-gc.exp index b707335eb04..1f5dabc1896 100644 --- a/gdb/testsuite/gdb.ada/inline-section-gc.exp +++ b/gdb/testsuite/gdb.ada/inline-section-gc.exp @@ -34,8 +34,25 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $options] != ""} { clean_restart ${testfile} -set bp_location [gdb_get_line_number "BREAK" ${testdir}/callee.adb] + +# Depending on the version of gnat, the location of the set breakpoint may +# be reported as being at the requested location in file callee.adb or in +# file caller.adb where the callee function was inlined. Either way, only +# on breakpoint should be reported and it's address should not be at 0x0. +# If the breakpoint is reported in caller, then the line number happens to +# be one less the the requested line number. +set bp_location1 [gdb_get_line_number "BREAK" ${testdir}/callee.adb] +set bp_location2 [expr $bp_location1 - 1] +set test "break callee.adb:$bp_location1" +set message "Breakpoint set" + # The bug here was that gdb would set a breakpoint with two locations, # one of them at 0x0. -gdb_test "break callee.adb:$bp_location" \ - "Breakpoint $decimal at $hex: file .*callee.adb, line $bp_location." +gdb_test_multiple $test $message { + -re "Breakpoint $decimal at $hex: file .*callee.adb, line $bp_location1." { + pass $test + } + -re "Breakpoint $decimal at $hex: file .*caller.adb, line $bp_location2." { + pass $test + } +} -- 2.37.2