From patchwork Mon Apr 9 15:15:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 26656 Received: (qmail 118436 invoked by alias); 9 Apr 2018 15:15:45 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 118386 invoked by uid 89); 9 Apr 2018 15:15:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=2122 X-HELO: mail-wr0-f196.google.com Received: from mail-wr0-f196.google.com (HELO mail-wr0-f196.google.com) (209.85.128.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Apr 2018 15:15:40 +0000 Received: by mail-wr0-f196.google.com with SMTP id 80so9971523wrb.2 for ; Mon, 09 Apr 2018 08:15:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=j1aRKYg8+MnuN93AGyEFVXvUrKlnX28lHn1hY353xvA=; b=H0oJb2C/fJo3XqRTq7+jFY5qy0k4jny7MvKdztCSGD4JvSrXBTiZCdxzkOGhLlVHYK HM4VpKueQTwniERBmyWXJHXb4/DoDTFcD1HqG2b+YOnS2yDDOZFDXRIBLZ/6JIQQdmgK XREtOp373dDVOuivux8fdyZiiiXcTwA42PETJ/xpOrnxxtTUYo5c0HHOEnmN5oD05Gam 6ZQrU/07fK3PxRw9MVf/1+U9FDcvEzLGxm2hfZ1CYr0p+xjgkRzd0dHcmoOjAB1RkVBv S0LK7hGr0VbShgVqvNocPqCDEBklot0dGojDTthgGEO/5hKh7i9nassSVCgTIllYJI16 VnYA== X-Gm-Message-State: AElRT7EvAj4nLOsinbR32HfLBpvQaSu1aOel5r+XQSV/hZ5mn1x2Q+0f e19cMGJcpkJ2yvgBCPpqYc/cL2ym X-Google-Smtp-Source: AIpwx484794ajMGcHjWxsknEfr6Tqly4BCror9jFnxT3qM3tUY1HkRxuhCxIaG8smp276Fp+mghKGg== X-Received: by 10.223.172.226 with SMTP id o89mr24319844wrc.264.1523286934760; Mon, 09 Apr 2018 08:15:34 -0700 (PDT) Received: from localhost (host81-148-252-121.range81-148.btcentralplus.com. [81.148.252.121]) by smtp.gmail.com with ESMTPSA id s49sm775635wrc.36.2018.04.09.08.15.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Apr 2018 08:15:34 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 2/3] gdb/testsuite: Filter out some registers for riscv Date: Mon, 9 Apr 2018 16:15:28 +0100 Message-Id: <994fa101380c1495e1ca97a6dcbfdb3bd23ae173.1523286728.git.andrew.burgess@embecosm.com> In-Reply-To: References: In-Reply-To: References: X-IsSubscribed: yes On riscv the cycle counter, and instructions retired counter CSRs are read only, this causes problems in the gdb.base/callfuncs.exp test, as the values in these CSRs change after an inferior call, the check that no target registers have been modified then fails. Luckily the test already has a mechanism in place for filtering out registers that are modified (and can't be restored) by an inferior call, so this commit adds the problem registers into this list for riscv. In the future we may end up needing to filter out more CSRs, but right now, for the targets I have access too, these are the only ones causing problems. gdb/testsuite/ChangeLog: * gdb.base/callfuncs.exp (fetch_all_registers): Add riscv register filter pattern. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.base/callfuncs.exp | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp index 94636938752..c5e39918c2a 100644 --- a/gdb/testsuite/gdb.base/callfuncs.exp +++ b/gdb/testsuite/gdb.base/callfuncs.exp @@ -285,6 +285,16 @@ proc fetch_all_registers {test} { } exp_continue } + -re "^\(?:cycle\|instret\)\[ \t\]+\[^\r\n\]+\r\n" { + if [istarget "riscv*-*-*"] { + # Filter out the cycle counter and instructions + # retired counter CSRs which are read-only, giving + # spurious differences. + } else { + lappend all_registers_lines $expect_out(0,string) + } + exp_continue + } -re "^\[^ \t\]+\[ \t\]+\[^\r\n\]+\r\n" { lappend all_registers_lines $expect_out(0,string) exp_continue