From patchwork Tue Feb 4 08:55:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Simon Marchi (Code Review)" X-Patchwork-Id: 37671 Received: (qmail 31795 invoked by alias); 4 Feb 2020 08:55:13 -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 31709 invoked by uid 89); 4 Feb 2020 08:55:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=H*R:U*noreply X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 04 Feb 2020 08:55:11 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 2E68C20562; Tue, 4 Feb 2020 03:55:10 -0500 (EST) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [IPv6:2620:52:3:1:5054:ff:fe06:16ca]) by mx1.osci.io (Postfix) with ESMTP id 82A622032B; Tue, 4 Feb 2020 03:55:07 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 5EE2928170; Tue, 4 Feb 2020 03:55:07 -0500 (EST) X-Gerrit-PatchSet: 2 Date: Tue, 4 Feb 2020 03:55:07 -0500 From: "Sourceware to Gerrit sync (Code Review)" To: Tom de Vries , gdb-patches@sourceware.org Cc: Simon Marchi Auto-Submitted: auto-generated X-Gerrit-MessageType: merged Subject: [pushed] [gdb/testsuite] Use non-capturing parentheses for inferior_exited_re X-Gerrit-Change-Id: I7640c6129b1ada617424d6a63730d4b119c58ef3 X-Gerrit-Change-Number: 763 X-Gerrit-ChangeURL: X-Gerrit-Commit: 780636aec079208cd8ee1079f27d0d5ac5dae48a In-Reply-To: References: Reply-To: noreply@gnutoolchain-gerrit.osci.io, simon.marchi@polymtl.ca, tdevries@suse.de, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-79-g83ff7f88f1 Message-Id: <20200204085507.5EE2928170@gnutoolchain-gerrit.osci.io> Sourceware to Gerrit sync has submitted this change. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/763 ...................................................................... [gdb/testsuite] Use non-capturing parentheses for inferior_exited_re The inferior_exited_re regexp uses capturing parentheses by default: ... set inferior_exited_re "(\\\[Inferior \[0-9\]+ \\(.*\\) exited)" ... The parentheses are there to be able to use the expression as an atom, f.i., to have '+' apply to the whole regexp in "${inferior_exited_re}+". But the capturing is not necessary, and it can be confusing because it's not obvious in a regexp using "$inferior_exited_re (bla|bli)" that the first captured expression is in $inferior_exited_re. Replace by non-capturing parentheses. If we still want to capture the expression, we can simply (and more clearly) use "($inferior_exited_re)". Build and reg-tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-02-04 Tom de Vries * lib/gdb.exp (inferior_exited_re): Use non-capturing parentheses. Change-Id: I7640c6129b1ada617424d6a63730d4b119c58ef3 --- M gdb/testsuite/ChangeLog M gdb/testsuite/lib/gdb.exp 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 2b1a8ba..bc61679 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2020-02-04 Tom de Vries + + * lib/gdb.exp (inferior_exited_re): Use non-capturing parentheses. + 2020-02-03 Rogerio A. Cardoso * gdb.arch/powerpc-power8.exp: Delete trailing whitespace of diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 2d230b7..25bed76 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -117,7 +117,7 @@ set octal "\[0-7\]+" -set inferior_exited_re "(\\\[Inferior \[0-9\]+ \\(.*\\) exited)" +set inferior_exited_re "(?:\\\[Inferior \[0-9\]+ \\(.*\\) exited)" # A regular expression that matches a value history number. # E.g., $1, $2, etc.