From patchwork Thu Dec 14 10:19:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 82133 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6ABD53858C20 for ; Thu, 14 Dec 2023 10:20:00 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 CC7493858D20 for ; Thu, 14 Dec 2023 10:19:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CC7493858D20 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 CC7493858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702549187; cv=none; b=DPO4eahLQvSbbfwueKmGVSwpXYqXXhjMRCGMTNLlNybyikzm8Qu7W2pF5DnM6GGVGujjCW0LgjND2jsbZSutVPC6LfuNPV8sFWvIopBYFqGq6Xgi40cuRnAaV8RU4bbQE5jRvx6GOBd0k1LWbmU9vft1XpIOW2wk8V6aP39OOXU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702549187; c=relaxed/simple; bh=FduA8WcMJUzyPRwzRGECLzHY1ymismywDjBegILiLFg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=nTpwhTmTvJLNkM3mGlEDlAsEgkjFxk9AYWmBsosOxWxkBQzUA2PHRjj1CN1Gw5oaner2pYxVEv+98hC3cInzkTK2yjrEByl6SexgUudDUezLYNUG+ZNwCHS+UNF8/8Ww+q7Y6bF1/hVjBvWql+XRXY9cv8KboTflcv1EKw2DKMQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702549182; 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; bh=446AKBQYl48XIhWGv3DhyEbcCI4uA7B4KVDyT6mJOgU=; b=OdluNPrkXikOyibC95Jqkqet+kBcPhJOoVhNVxWkoA1wwfDD10KlTXFgu95F82Eodff+LG /tkG2IdbrWJSeLKOyjWJsegniG4VTi3D6szwZxWpAHiO1eTqx/nM2neIukZiNVqtayQOHf XwYuvCVWLw4hyrmTH6mCNof1KoDkDOQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-361-s42jek7hP4S2djRY4RyZug-1; Thu, 14 Dec 2023 05:19:41 -0500 X-MC-Unique: s42jek7hP4S2djRY4RyZug-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EA874867942 for ; Thu, 14 Dec 2023 10:19:40 +0000 (UTC) Received: from fedora.brq.redhat.com (unknown [10.43.3.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 733211C060B2; Thu, 14 Dec 2023 10:19:40 +0000 (UTC) From: Guinevere Larsen To: gdb-patches@sourceware.org Cc: Guinevere Larsen Subject: [PATCH] gdb/testsuite: relax filename restriction in some gdb.btrace tests Date: Thu, 14 Dec 2023 11:19:35 +0100 Message-ID: <20231214101935.2231336-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.5 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, RCVD_IN_MSPIKE_H4, 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 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+patchwork=sourceware.org@sourceware.org The test gdb.btrace/tailcall.exp has multiple tests that include the filename in the output. When testing with gcc, only a relative path is printed, but when using clang, the full file path is printed instead. This makes most of those tests fail, with the exception of "record goto 4" which allows for more characters before the file name. The test gdb.btrace/recod_goto.exp suffers with the same issue This commit changes all relevant tests in both files to work like that, so that the test stops failing with clang. --- gdb/testsuite/gdb.btrace/record_goto.exp | 22 ++++++++--------- gdb/testsuite/gdb.btrace/tailcall.exp | 30 ++++++++++++------------ 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/gdb/testsuite/gdb.btrace/record_goto.exp b/gdb/testsuite/gdb.btrace/record_goto.exp index 1817ac07f51..f7d4f5ba612 100644 --- a/gdb/testsuite/gdb.btrace/record_goto.exp +++ b/gdb/testsuite/gdb.btrace/record_goto.exp @@ -80,7 +80,7 @@ gdb_test "record function-call-history /ci 1, +20" [multi_line \ ] # let's see if we can go back in history -gdb_test "record goto 19" ".*fun4 \\(\\) at record_goto.c:43.*" +gdb_test "record goto 19" ".*fun4 \\(\\) at .*record_goto.c:43.*" # the function call history should start at the new location gdb_test "record function-call-history /ci" [multi_line \ @@ -97,19 +97,19 @@ gdb_test "record instruction-history" [multi_line \ ] "instruction-history from 19 forwards" # let's go to another place in the history -gdb_test "record goto 27" ".*fun3 \\(\\) at record_goto.c:35.*" +gdb_test "record goto 27" ".*fun3 \\(\\) at .*record_goto.c:35.*" # check the back trace at that location gdb_test "backtrace" [multi_line \ - "#0.*fun3.*at record_goto.c:35.*" \ - "#1.*fun4.*at record_goto.c:43.*" \ - "#2.*main.*at record_goto.c:49.*" \ + "#0.*fun3.*at .*record_goto.c:35.*" \ + "#1.*fun4.*at .*record_goto.c:43.*" \ + "#2.*main.*at .*record_goto.c:49.*" \ "Backtrace stopped: not enough registers or memory available to unwind further" \ ] # walk the backtrace -gdb_test "up" ".*fun4.*at record_goto.c:43.*" "up to fun4" -gdb_test "up" ".*main.*at record_goto.c:49.*" "up to main" +gdb_test "up" ".*fun4.*at .*record_goto.c:43.*" "up to fun4" +gdb_test "up" ".*main.*at .*record_goto.c:49.*" "up to main" # the function call history should start at the new location gdb_test "record function-call-history /ci -" [multi_line \ @@ -126,7 +126,7 @@ gdb_test "record instruction-history -" [multi_line \ ] "instruction-history from 27 backwards" # test that we can go to the begin of the trace -gdb_test "record goto begin" ".*main \\(\\) at record_goto.c:49.*" +gdb_test "record goto begin" ".*main \\(\\) at .*record_goto.c:49.*" # check that we're filling up the context correctly gdb_test "record function-call-history /ci -" [multi_line \ @@ -143,7 +143,7 @@ gdb_test "record instruction-history -" [multi_line \ ] "instruction-history from begin backwards" # we should get the exact same history from the first instruction -gdb_test "record goto 2" ".*fun4 \\(\\) at record_goto.c:40.*" +gdb_test "record goto 2" ".*fun4 \\(\\) at .*record_goto.c:40.*" # check that we're filling up the context correctly gdb_test "record function-call-history /ci -" [multi_line \ @@ -160,7 +160,7 @@ gdb_test "record instruction-history -" [multi_line \ ] "instruction-history from 2 backwards" # check that we can go to the end of the trace -gdb_test "record goto end" ".*main \\(\\) at record_goto.c:50.*" +gdb_test "record goto end" ".*main \\(\\) at .*record_goto.c:50.*" # check that we're filling up the context correctly gdb_test "record function-call-history /ci" [multi_line \ @@ -177,7 +177,7 @@ gdb_test "record instruction-history" [multi_line \ ] "instruction-history from end forwards" # we should get the exact same history from the second to last instruction -gdb_test "record goto 39" ".*fun4 \\(\\) at record_goto.c:44.*" +gdb_test "record goto 39" ".*fun4 \\(\\) at .*record_goto.c:44.*" # check that we're filling up the context correctly gdb_test "record function-call-history /ci" [multi_line \ diff --git a/gdb/testsuite/gdb.btrace/tailcall.exp b/gdb/testsuite/gdb.btrace/tailcall.exp index 7fbcd40c077..b2548b9ba11 100644 --- a/gdb/testsuite/gdb.btrace/tailcall.exp +++ b/gdb/testsuite/gdb.btrace/tailcall.exp @@ -77,35 +77,35 @@ gdb_test "record goto 4" ".*bar \\(\\) at .*tailcall.c:24\r\n.*" # check the backtrace gdb_test "backtrace" [multi_line \ - "#0.*bar \\(\\) at tailcall.c:24" \ - "#1.*foo \\(\\) at tailcall.c:29" \ - "#2.*main \\(\\) at tailcall.c:37" \ + "#0.*bar \\(\\) at .*tailcall.c:24" \ + "#1.*foo \\(\\) at .*tailcall.c:29" \ + "#2.*main \\(\\) at .*tailcall.c:37" \ "Backtrace stopped: not enough registers or memory available to unwind further" \ ] # walk the backtrace -gdb_test "up" "#1\[^\r\n\]*foo \\(\\) at tailcall.c:29\r\n.*" "up to foo" -gdb_test "up" "#2\[^\r\n\]*main \\(\\) at tailcall.c:37\r\n.*" "up to main" -gdb_test "down" "#1\[^\r\n\]*foo \\(\\) at tailcall.c:29\r\n.*" "down to foo" +gdb_test "up" "#1\[^\r\n\]*foo \\(\\) at .*tailcall.c:29\r\n.*" "up to foo" +gdb_test "up" "#2\[^\r\n\]*main \\(\\) at .*tailcall.c:37\r\n.*" "up to main" +gdb_test "down" "#1\[^\r\n\]*foo \\(\\) at .*tailcall.c:29\r\n.*" "down to foo" # test stepping into and out of tailcalls. -gdb_test "finish" "\[^\r\n\]*main \\(\\) at tailcall.c:38\r\n.*" \ +gdb_test "finish" "\[^\r\n\]*main \\(\\) at .*tailcall.c:38\r\n.*" \ "finish.1" -gdb_test "reverse-step" "\[^\r\n\]*bar \\(\\) at tailcall.c:24\r\n.*" \ +gdb_test "reverse-step" "\[^\r\n\]*bar \\(\\) at .*tailcall.c:24\r\n.*" \ "reverse-step.1" -gdb_test "reverse-finish" "\[^\r\n\]*foo \\(\\) at tailcall.c:29\r\n.*" \ +gdb_test "reverse-finish" "\[^\r\n\]*foo \\(\\) at .*tailcall.c:29\r\n.*" \ "reverse-finish.1" -gdb_test "reverse-step" "\[^\r\n\]*main \\(\\) at tailcall.c:37\r\n.*" \ +gdb_test "reverse-step" "\[^\r\n\]*main \\(\\) at .*tailcall.c:37\r\n.*" \ "reverse-step.2" gdb_test "next" "\[^\r\n\]*38.*" \ "next.1" -gdb_test "reverse-next" "\[^\r\n\]*main \\(\\) at tailcall.c:37\r\n.*" \ +gdb_test "reverse-next" "\[^\r\n\]*main \\(\\) at .*tailcall.c:37\r\n.*" \ "reverse-next.1" -gdb_test "step" "\[^\r\n\]*foo \\(\\) at tailcall.c:29\r\n.*" \ +gdb_test "step" "\[^\r\n\]*foo \\(\\) at .*tailcall.c:29\r\n.*" \ "step.1" -gdb_test "finish" "\[^\r\n\]*main \\(\\) at tailcall.c:38\r\n.*" \ +gdb_test "finish" "\[^\r\n\]*main \\(\\) at .*tailcall.c:38\r\n.*" \ "finish.2" -gdb_test "reverse-step" "\[^\r\n\]*bar \\(\\) at tailcall.c:24\r\n.*" \ +gdb_test "reverse-step" "\[^\r\n\]*bar \\(\\) at .*tailcall.c:24\r\n.*" \ "reverse-step.3" -gdb_test "finish" "\[^\r\n\]*main \\(\\) at tailcall.c:38\r\n.*" \ +gdb_test "finish" "\[^\r\n\]*main \\(\\) at .*tailcall.c:38\r\n.*" \ "finish.3"