From patchwork Thu Mar 2 22:04:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Frager, Neal via Binutils" X-Patchwork-Id: 63606 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp94209wrd; Thu, 2 Mar 2023 14:09:55 -0800 (PST) X-Google-Smtp-Source: AK7set+xMEUvuthlUpfW9Re7gZ89hStWf4rhjpidpCvV+mS1P8ooW52vPUNqvev2kSD6dBLgChWu X-Received: by 2002:a17:906:48c1:b0:8e9:9e13:9290 with SMTP id d1-20020a17090648c100b008e99e139290mr11963120ejt.27.1677794995218; Thu, 02 Mar 2023 14:09:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677794995; cv=none; d=google.com; s=arc-20160816; b=QjtrbnbcaCCL8Qmi1joLXXYByGkwdGe9AbziO0sv0/CExBd6U/4+yaYtElemDwmWdH TQKtS3SH42tEG/JUWYkj/pJNe4wfmGXe8MtGog4ZFk6juHQCLoHtluNakqJ9HLY6LB2r YjKgFQjgoq14HNUoB3QjO9g2gStkm0iVCGh+hMnBnbv+H0aeSYh19NInK1+orq4nb8oN HN6eptyyWQp8BsYmLnQpDnc+t+muezqnmyNDfkeS2rR/MKKcDOOkeRJ3cncGUxQXlhbt in72UP0EG1k4hrf6lQYA5PBGSMoYkpv8+IKmiVs/5/dFhhz3jdqaSojbqA5NPzfONomm Y0xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=4yv/w3ae8TRkMXLr9SzKdfulfyHMJptbM5Dofi8aXSM=; b=NyUXdydhsiwFmTnbfU9UGBwUiZnkarofT5S6FUVMiqo+WrmmAwJQsdfkCWzEORjVKq rTSUYbow0IzzOtXJShoLD+i3ZGMoqSLPGNjjDH/YpcGxeLk67APuq6pEzm4e6TPcbf7u eE047KHiEN022pDQ0K8woTy6qhEAxRuh8E5SNAP3YBPa5b4RB+3rY4ZEqC2Amw6Gg8wm jFJUcykSthqlJo9FQicQWlg9ILAlPNtRAnMh7Un2/cFqTFuw2c8HiFxDeVBG7nRw4+3v VgUOSgO8bdHs0lzVG6seZAtInJLEOgDtxJQpqSoVaVoGBPsDjQrZhGA4Dqv0mrUMbKBy aVtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=TU0JJzVI; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org ([2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id sb24-20020a170906edd800b008cf79b051cesi357900ejb.895.2023.03.02.14.09.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Mar 2023 14:09:55 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=TU0JJzVI; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8B387382CD55 for ; Thu, 2 Mar 2023 22:06:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B387382CD55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677794800; bh=4yv/w3ae8TRkMXLr9SzKdfulfyHMJptbM5Dofi8aXSM=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=TU0JJzVIOdNk2ghu9NwHed8EN5WBgscP5QX6sFKKQ7zP9WhxIAQnCHXgIZ6rCeX77 oXY4Duh/sw0w0/7DymYeVhh4pG+KhFl2+BRIntWalc2EJZo8fBd+dhxvgVNT30OAcc 7FDBbm4M5c1oYGrpuHTlKvjbNeczY+VH/Lkk9ri8= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org 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 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) Received-SPF: pass (emagii.beebytevps.io: connection is authenticated) 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 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Ulf Samuelsson via Binutils From: "Frager, Neal via Binutils" Reply-To: binutils@emagii.com Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759295564983541359?= X-GMAIL-MSGID: =?utf-8?q?1759295564983541359?= 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"