From patchwork Wed Mar 1 12:44:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 65834 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 0F1DB3858416 for ; Wed, 1 Mar 2023 12:44:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0F1DB3858416 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677674679; bh=P1Dn1KQ7P1O8QNWv7OAeMIeo8/ZBCw044yKan7up85I=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Jb2Ej7wemTdxamdMI7bzbX/BYju2LbV8hf5eQW65YHAtX+ST2DwcDg8CW3iR7Kocz 1mgQHn0ZwbVJ5oSzj2oY9Ayq2sKrnZKUiG54vr+FJfg+l1W7XHtNpuwHrgd5o72gaV VOUR02SSsSFtJm2CJY/hy/He12/11ua8zeEmfHL8= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 31BBD3858D33 for ; Wed, 1 Mar 2023 12:44:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 31BBD3858D33 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 5E20321A74 for ; Wed, 1 Mar 2023 12:44:13 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4A4FF13A63 for ; Wed, 1 Mar 2023 12:44:13 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id PIPsEJ1I/2MKegAAMHmgww (envelope-from ) for ; Wed, 01 Mar 2023 12:44:13 +0000 To: gdb-patches@sourceware.org Subject: [pushed] [gdb/testsuite] Add another xfail case in gdb.python/py-record-btrace.exp Date: Wed, 1 Mar 2023 13:44:24 +0100 Message-Id: <20230301124424.28398-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP 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-Patchwork-Original-From: Tom de Vries via Gdb-patches From: Tom de Vries Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" I ran into: ... (gdb) PASS: gdb.python/py-record-btrace.exp: function call: \ python print(c.prev) python print(c == c.next.prev)^M Traceback (most recent call last):^M File "", line 1, in ^M AttributeError: 'NoneType' object has no attribute 'prev'^M Error while executing Python code.^M (gdb) FAIL: gdb.python/py-record-btrace.exp: function call: \ python print(c == c.next.prev) ... due to having only 4 insn instead of 100: ... python print(len(insn))^M 4^M ... This could be caused by the same hw bug as we already have an xfail for, so expand the xfail matching. Tested on x86_64-linux. PR testsuite/30185 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30185 Approved-By: Markus T. Metzger --- gdb/testsuite/gdb.python/py-record-btrace.exp | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) base-commit: d80081ef39c729b0f5f548c9567be2d80dcc2fd0 diff --git a/gdb/testsuite/gdb.python/py-record-btrace.exp b/gdb/testsuite/gdb.python/py-record-btrace.exp index 703db0ce8e1..bd397d3c974 100644 --- a/gdb/testsuite/gdb.python/py-record-btrace.exp +++ b/gdb/testsuite/gdb.python/py-record-btrace.exp @@ -101,6 +101,25 @@ with_test_prefix "prepare record" { return } + # Also handle the case that we're running into the hw bug without + # triggering a decode error. + gdb_test_multiple "python print(len(insn))" "" { + -re -wrap "100" { + pass $gdb_test_name + } + -re -wrap "" { + if { $have_xfail } { + xfail $gdb_test_name + set got_xfail 1 + } else { + fail $gdb_test_name + } + } + } + if { $got_xfail } { + return + } + gdb_test_no_output "python call = r.function_call_history" gdb_test_no_output "python i = insn\[0\]" gdb_test_no_output "python c = call\[0\]" @@ -138,7 +157,6 @@ with_test_prefix "function call" { } with_test_prefix "list" { - gdb_test "python print(len(insn))" "100" gdb_test "python print(len(insn\[23:65\]))" "42" gdb_test "python print(insn\[17:\]\[2\].number)" "20" gdb_test "python print(i in insn)" "True"