From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id ABE80385702F for ; Wed, 8 Nov 2023 12:01:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ABE80385702F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org ABE80385702F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699444920; cv=none; b=MWiHZjs/E5NHMXaTDXYtYJmzjvXaPxCG/VJcsOQtTGXLE/XR6AYja7Xt51wJQpSkxt+AwVxRTXd2BKtZn0W8EOAQtVrcwq/r4RyjC3bW1GUd3aczPQ//htjtUw2F1CRSiVCg1szhStGgJpyDSwmmYK9fdTXNO0hMmrn9sbJOobo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699444920; c=relaxed/simple; bh=X+RvI17RrjRz9yOEcZSvY0GwVDamvFZYYUZY2trsOJA=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=JyOMvrKUpIO/mSOlUYfpu612jXeMIz2D7j13wMCPAR2qGHnx3DhHriPyP2ewaFUh8N6eL9zmaVYQ+6BahB4Q8ZOGLrLASIxnGXTxM+1YHuIqKJw389/Ljel0KctG2erDCJ4CokvPNB5pxfyF4Bsqzv/1sqYf/K8UfFobZkfZPZE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699444909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=broRMqRlASp0GsNukTFClVb+iBByvAAbtAV8N7UqPpc=; b=CHfwK5uqMu5DMRLLBFoHZjHqBACA/mAvQiClwnIWZNXJo3VkCgeOkTGOE6adV4ExgmnQVw R34YwfcF1GuJXY+dWG6zNjz6JrLFqsNvJ974/m13+cl5+RaQl9xuNBCtCbCbOmufqzIw34 wks/DBbah+zqAiIjSbpREVDZiwqKzl0= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-640-xGJjRjmvN4WZl6s8DJYh-g-1; Wed, 08 Nov 2023 07:01:48 -0500 X-MC-Unique: xGJjRjmvN4WZl6s8DJYh-g-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-9c15543088aso89603066b.1 for ; Wed, 08 Nov 2023 04:01:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699444907; x=1700049707; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=broRMqRlASp0GsNukTFClVb+iBByvAAbtAV8N7UqPpc=; b=gzfBPA7C+DKMj6jtDub1HTzo6qAHcLEUdYuslnS0bOoLhXbmyR83pvaW2KyLiUzjpR UaRe4PHgnNbw1wq0K+eVc5ZR9Jf78LMBjn8fpFEKAwaCK1QxOgvj5R6nPWV8IwDjVjw9 Pyb5KL0iDqRoGIFkTpXc9c8yqqiX5ncKgCyqzqz1z/Lp4AT7sTwDIuX6ogR6mRX9le0E BPH66BOSiIL/E8ZmYal62fOXoBTBkjywPsVVpRPHrHQYcfy4r45LRW7sAXP/90KdKhB4 e1K21Ee3KBe4jtuT12aJBcKDV1GhoRY9/dRKmz6gOjSWfensPq5HWmiDsOPwLhaosRMa 8ZZA== X-Gm-Message-State: AOJu0Yx744uqChwM4q+3x+hvk8xcry1rrxw4xOf2XPb1pVOh5ZHN+GVF AlyphcPIIxUfIInt9NLxjwMenWjQj7Q33DI172CdDUjm76OwNao/dopszRtFJav6qSMDUFtt/6c 7JTtMrnPeO5ZNpcIwlg/zsQ== X-Received: by 2002:a17:906:1044:b0:9ad:cbc0:9f47 with SMTP id j4-20020a170906104400b009adcbc09f47mr5087427ejj.12.1699444906948; Wed, 08 Nov 2023 04:01:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IEEDc95Wr3DxzEAiIeNktO9mcBpFak6Sk3wz3t/bKTwR4kDnIjRz4F4aGRutgQfOnU3zidVeg== X-Received: by 2002:a17:906:1044:b0:9ad:cbc0:9f47 with SMTP id j4-20020a170906104400b009adcbc09f47mr5087412ejj.12.1699444906623; Wed, 08 Nov 2023 04:01:46 -0800 (PST) Received: from [192.168.0.129] (ip-94-112-227-180.bb.vodafone.cz. [94.112.227.180]) by smtp.gmail.com with ESMTPSA id o19-20020a17090608d300b0099cc3c7ace2sm947195eje.140.2023.11.08.04.01.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Nov 2023 04:01:46 -0800 (PST) Message-ID: Date: Wed, 8 Nov 2023 13:01:45 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH] Powerpc, fix for test gdb.base/unwind-on-each-insn.exp To: Luis Machado , Carl Love , gdb-patches@sourceware.org, Tom Tromey Cc: Ulrich Weigand References: <28eb1ebbaad9ad0a114d628e79072a0320c659f5.camel@linux.ibm.com> <586ff3e3-f439-4db9-9801-b3cebf663725@arm.com> From: Guinevere Larsen In-Reply-To: <586ff3e3-f439-4db9-9801-b3cebf663725@arm.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 List-Id: On 08/11/2023 12:59, Luis Machado wrote: > Hi Carl, > > Is the message body referring to a distinct patch than the one attached? The subject mentions > gdb.base/unwind-on-each-insn.exp, but the patch deals with gdb.ada/inline-section-gc.exp. I read through, and I think carl just used the wrong test name on the email body/subject. The point of gdb.base/unwind-on-each-insn.exp is completely different. -- Cheers, Guinevere Larsen She/Her/Hers > > On 11/7/23 21:29, Carl Love wrote: >> GDB maintainers, Luis, Tom: >> >> Here is the patch to fix test gdb.base/unwind-on-each-insn.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 >> + } >> +}