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 AB8BB3857367 for ; Thu, 26 May 2022 15:11:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AB8BB3857367 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-134-H-OBN_PgOzuJdDJ1tcOLBQ-1; Thu, 26 May 2022 11:11:23 -0400 X-MC-Unique: H-OBN_PgOzuJdDJ1tcOLBQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E5E13803CB8 for ; Thu, 26 May 2022 15:11:22 +0000 (UTC) Received: from blarsen.com (ovpn-116-42.gru2.redhat.com [10.97.116.42]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1F3AE2026D64; Thu, 26 May 2022 15:11:21 +0000 (UTC) From: Bruno Larsen To: gdb-patches@sourceware.org Subject: [PATCH v3 11/14] gdb/testsuite: Update gdb.base/so-impl-ld.exp Date: Thu, 26 May 2022 12:10:38 -0300 Message-Id: <20220526151041.23223-12-blarsen@redhat.com> In-Reply-To: <20220526151041.23223-1-blarsen@redhat.com> References: <20220526151041.23223-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, 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: Thu, 26 May 2022 15:11:26 -0000 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 generically deal with unknown number of steps until leaving that function. --- New in v3. --- 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 69c35d4c7ac..6602aaadae0 100644 --- a/gdb/testsuite/gdb.base/so-impl-ld.exp +++ b/gdb/testsuite/gdb.base/so-impl-ld.exp @@ -60,21 +60,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_regexp ".*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