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.129.124]) by sourceware.org (Postfix) with ESMTPS id 032ED384D18F for ; Mon, 12 Sep 2022 12:30:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 032ED384D18F Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-635-1L4NPYC9PKa4Z3g18wksfA-1; Mon, 12 Sep 2022 08:30:06 -0400 X-MC-Unique: 1L4NPYC9PKa4Z3g18wksfA-1 Received: by mail-wr1-f71.google.com with SMTP id g19-20020adfa493000000b0022a2ee64216so1596582wrb.14 for ; Mon, 12 Sep 2022 05:30:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date; bh=hZ/kPSs08/H4MQo41Q0M+70L27f7edmopHl7Jnpi7bM=; b=H+IGEMAd04BJn16rmNtN0TmovPTYAUlZMbeAtZIVmxX/fHtM02oahMw/c9MiCmPP3M 3HSsWqhSO90U69fIlYVCP142eNnNNglbqC5PHG271wY1QRcR0qRvK1vEML6ZEgvpZsQV Lf44WdvoepDxJYTGCB0doH3P61bRdZbH8EWik+dUWDzRyqMyfIygnfEV98hCVWlUgenj agTwZH7t9+US3gOe4P9V0MpLKOwauDmPSoB6hAOi+KKMGuEqtBNVcig7i5z8bwJ6U/89 EQD8lQucwTOWcbvTva1SQyGqOzDwM01cFmDlUXOre7DVnvaogpeQOYcK8BmL5XZIjh2n qUBQ== X-Gm-Message-State: ACgBeo0ZHNbvPvEaBbHSY/DOnxgO47Pttgivbn3s/WK5JMefPhKRZTnm TMGeqOdNi45vDGUh2M6spOBYhcHEylyEaJSHhAP67kXzUPKzjYbi2z3IWusf9NoxylcjmQ0ebdY ZxQwypvkZcfACgnYT+h2niA== X-Received: by 2002:a05:6000:1ac9:b0:22a:85b3:8495 with SMTP id i9-20020a0560001ac900b0022a85b38495mr3136157wry.253.1662985805151; Mon, 12 Sep 2022 05:30:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR6H0HWkRMOsxnKZL2bswZL4hnfUefHITGWmLHrPlIis7z7lNCqwbwbB8TPtHt3wL87J2Ce0hw== X-Received: by 2002:a05:6000:1ac9:b0:22a:85b3:8495 with SMTP id i9-20020a0560001ac900b0022a85b38495mr3136147wry.253.1662985804887; Mon, 12 Sep 2022 05:30:04 -0700 (PDT) Received: from localhost (52.72.115.87.dyn.plus.net. [87.115.72.52]) by smtp.gmail.com with ESMTPSA id x4-20020a05600c188400b003a3170a7af9sm9472976wmp.4.2022.09.12.05.30.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 05:30:04 -0700 (PDT) From: Andrew Burgess To: Bruno Larsen , gdb-patches@sourceware.org Subject: Re: [PATCH v4 11/15] gdb/testsuite: Update gdb.base/so-impl-ld.exp In-Reply-To: <20220720194441.168906-13-blarsen@redhat.com> References: <20220720194441.168906-1-blarsen@redhat.com> <20220720194441.168906-13-blarsen@redhat.com> Date: Mon, 12 Sep 2022 13:30:03 +0100 Message-ID: <87bkrklqr8.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, 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: Mon, 12 Sep 2022 12:30:13 -0000 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