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 D7737384D15A for ; Tue, 13 Sep 2022 12:08:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D7737384D15A Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-62-n01BsOAPNVaCMgD7sIldTw-1; Tue, 13 Sep 2022 08:08:07 -0400 X-MC-Unique: n01BsOAPNVaCMgD7sIldTw-1 Received: by mail-ej1-f71.google.com with SMTP id xj11-20020a170906db0b00b0077b6ecb23fcso2622538ejb.5 for ; Tue, 13 Sep 2022 05:08:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=0bExcq5xSHeBOOKR45kIgSpaOBi/ZhcoOebWCOv/kw8=; b=ZrDL9NzFZwA/BFgACZcbdSV/sVvaQ7RWV+ySAT4ntjqGNy+yUymCLP/o/+VqOPBnfs KkYKDZvnUhMjR+mEf5mxqYqre65hAq8j3KR0rChBFeWVRx7zB8kRZp88WGcgZ2YOK1sl ATUCaA+IUvEdsPNZ6h9aKg7JJWPPQApvXxPtI79u9SUnnylKzSUjAYi10g/6UN3Q5O1z MDfahCp1b19xxlNk6weLCe/bOK09SGL7qTWTwDDcDHSV3mqW+nDrqkl8wM4hDjheXS0G Ctfv9sToHwcRRRksoQsofwj1YE0sVqQVaxRZeE9Q7yz6cTSXYAMAhxGFjLqCf+/cM9oe /Zcg== X-Gm-Message-State: ACgBeo3JFSiBZ3UYaWnd9f57t5tOf5dHdncw1cW+QFKp6NbNIrQ1Z6RJ iPCDyeJcYPc72AKNocSmp2xitUuwx2BdIkkqhYhtc8hn6ViHuvifQPGgdulWcqX+4lP+/8m2iVk AZ8dsHOtGPClucNVZ1wX5gA== X-Received: by 2002:a17:907:a0c7:b0:77c:b9cb:be17 with SMTP id hw7-20020a170907a0c700b0077cb9cbbe17mr7716351ejc.335.1663070885924; Tue, 13 Sep 2022 05:08:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR57cAZEuQButj+NTaBikMn09UayTWWVPE+X6zI7QQbLTKSne4L8+qpMYK562e2hWmC9wlvXdQ== X-Received: by 2002:a17:907:a0c7:b0:77c:b9cb:be17 with SMTP id hw7-20020a170907a0c700b0077cb9cbbe17mr7716335ejc.335.1663070885697; Tue, 13 Sep 2022 05:08:05 -0700 (PDT) Received: from [192.168.0.45] (ip-213-220-232-121.bb.vodafone.cz. [213.220.232.121]) by smtp.gmail.com with ESMTPSA id k6-20020a17090632c600b0072b7d76211dsm5979005ejk.107.2022.09.13.05.08.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 13 Sep 2022 05:08:05 -0700 (PDT) Message-ID: Date: Tue, 13 Sep 2022 14:08:04 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [PATCH v4 11/15] gdb/testsuite: Update gdb.base/so-impl-ld.exp To: Andrew Burgess , gdb-patches@sourceware.org References: <20220720194441.168906-1-blarsen@redhat.com> <20220720194441.168906-13-blarsen@redhat.com> <87bkrklqr8.fsf@redhat.com> From: Bruno Larsen In-Reply-To: <87bkrklqr8.fsf@redhat.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.5 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_LOW, 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: Tue, 13 Sep 2022 12:08:11 -0000 Thanks, I pushed them both! Cheers, Bruno On 12/09/2022 14:30, Andrew Burgess wrote: > Bruno Larsen via Gdb-patches writes: > >> gdb.base/so-impl-ld.exp was setup assuming that the compiler would add >> epilogue information and that GDB would stop in the } line. This would >> make clang tests fail like so: >> >> step^M >> solib_main (arg=10000) at ../../../common/git-repos/binutils-gdb/gdb/testsuite/gdb.base/solib1.c:7^M >> 7|__ return arg*arg;|__|___/* HERE */^M >> (gdb) PASS: gdb.base/so-impl-ld.exp: step into solib call >> next^M >> main () at ../../../common/git-repos/binutils-gdb/gdb/testsuite/gdb.base/so-impl-ld.c:22^M >> 22|_ return 0;^M >> (gdb) FAIL: gdb.base/so-impl-ld.exp: step in solib call >> next^M >> 0x00007ffff7cef560 in __libc_start_call_main () from /lib64/libc.so.6^M >> (gdb) FAIL: gdb.base/so-impl-ld.exp: step out of solib call >> >> This patch changes it so solib_main has 2 lines where GDB can stop >> regardless of compiler weirdness, and updates the exp file to > s/weirdness/choices/ - I don't think there's necessarily anything > "weird" about Clang's choice, it's just different. > > With that change, I think you can push this patch, and the patch that > provides gdb_step_until. > > Thanks, > Andrew > >> generically deal with unknown number of steps until leaving that >> function. >> --- >> gdb/testsuite/gdb.base/so-impl-ld.exp | 13 ++----------- >> gdb/testsuite/gdb.base/solib1.c | 5 +++-- >> 2 files changed, 5 insertions(+), 13 deletions(-) >> >> diff --git a/gdb/testsuite/gdb.base/so-impl-ld.exp b/gdb/testsuite/gdb.base/so-impl-ld.exp >> index 372b18f3915..3c5d1070a5b 100644 >> --- a/gdb/testsuite/gdb.base/so-impl-ld.exp >> +++ b/gdb/testsuite/gdb.base/so-impl-ld.exp >> @@ -56,21 +56,12 @@ gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:${decimal}.* HERE .*" \ >> >> # Verify that we can step within the shlib call. >> # >> -gdb_test "next" "${decimal}\[ \t\]*\}.* STEP .*" "step in solib call" >> +gdb_test "next" "${decimal}\[ \t\]*return ans;.* STEP .*" "step in solib call" >> >> # Verify that we can step out of the shlib call, and back out into >> # the caller. >> # >> -gdb_test_multiple "next" "step out of solib call" { >> - -re "0x\[0-9a-f\]*\[ \t\]*9\[ \t\]*.*$gdb_prompt $" { >> - gdb_test "next" \ >> - "main .. at.*so-impl-ld.c:22.*" \ >> - "step out of solib call" >> - } >> - -re "main .. at.*so-impl-ld.c:22.*$gdb_prompt $" { >> - pass "step out of solib call" >> - } >> -} >> +gdb_step_until ".*main .. at.*return 0;.*" "step out of solib call" >> >> gdb_exit >> return 0 >> diff --git a/gdb/testsuite/gdb.base/solib1.c b/gdb/testsuite/gdb.base/solib1.c >> index 16b72338f26..bf52beec5de 100644 >> --- a/gdb/testsuite/gdb.base/solib1.c >> +++ b/gdb/testsuite/gdb.base/solib1.c >> @@ -4,5 +4,6 @@ extern "C" >> int >> solib_main (int arg) >> { >> - return arg*arg; /* HERE */ >> -} /* STEP */ >> + int ans = arg*arg; /* HERE */ >> + return ans; /* STEP */ >> +} >> -- >> 2.31.1