From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from emagii.se (www.emagii.com [185.133.207.17]) by sourceware.org (Postfix) with ESMTPS id B7EB0385700E for ; Thu, 2 Mar 2023 22:04:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B7EB0385700E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=emagii.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=emagii.com Received: from valinor.ownit.se (84-55-68-216.customers.ownit.se [84.55.68.216]) by emagii.se (Postfix) with ESMTPSA id 7C16712018B; Thu, 2 Mar 2023 23:04:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emagii.com; s=default; t=1677794675; bh=4yv/w3ae8TRkMXLr9SzKdfulfyHMJptbM5Dofi8aXSM=; h=From:To:Subject; b=fR1w9hpPUT9WGJeTTmpeCCd6gv/MqU6IQnPoGWm2Az5fXeqzep6V0cGtRRrymSyFC bKCkZFfCspr5CdoAlAoZ0XrVuktjl60ZpvOgFrmDh94fUyGwfA6KTXs4pIe/51kluh Rg44g7wzx9NvxcGXUPmFuNr8wwwBR/ySCF7WNmz8= Authentication-Results: emagii.beebytevps.io; spf=pass (sender IP is 84.55.68.216) smtp.mailfrom=binutils@emagii.com smtp.helo=valinor.ownit.se Received-SPF: pass (emagii.beebytevps.io: connection is authenticated) From: binutils@emagii.com To: binutils@sourceware.org Cc: nickc@redhat.com, Tom de Vries , "Markus T . Metzger" Subject: [PATCH v9 09/11] [gdb/testsuite] Add another xfail case in gdb.python/py-record-btrace.exp Date: Thu, 2 Mar 2023 23:04:06 +0100 Message-Id: <20230302220408.1925678-10-binutils@emagii.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230302220408.1925678-1-binutils@emagii.com> References: <20230302220408.1925678-1-binutils@emagii.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-PPP-Message-ID: <167779467577.1167749.135041310937362418@localhost.localdomain> X-PPP-Vhost: emagii.com X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_FAIL,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 List-Id: From: Tom de Vries 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(-) 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" -- 2.34.1