From patchwork Mon Feb 3 15:14:53 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: 37653 Received: (qmail 32444 invoked by alias); 3 Feb 2020 15:15:00 -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 32424 invoked by uid 89); 3 Feb 2020 15:15:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=HX-Languages-Length:2004, HContent-Transfer-Encoding:8bit 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; Mon, 03 Feb 2020 15:14:58 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 45369204A7; Mon, 3 Feb 2020 10:14:57 -0500 (EST) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [8.43.85.239]) by mx1.osci.io (Postfix) with ESMTP id 9C5122032B for ; Mon, 3 Feb 2020 10:14:53 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 6CA5628170 for ; Mon, 3 Feb 2020 10:14:53 -0500 (EST) X-Gerrit-PatchSet: 1 Date: Mon, 3 Feb 2020 10:14:53 -0500 From: "Tom de Vries (Code Review)" To: gdb-patches@sourceware.org Message-ID: Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange Subject: [review] [gdb/testsuite] Make inferior_exited_re match a single line X-Gerrit-Change-Id: Id7b1dcecd8c7fda3d1ab34b4fa1364d301748333 X-Gerrit-Change-Number: 764 X-Gerrit-ChangeURL: X-Gerrit-Commit: a5a066e7cebc957d9478397fc98aea904965cd2b References: Reply-To: tdevries@suse.de, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-79-g83ff7f88f1 Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/764 ...................................................................... [gdb/testsuite] Make inferior_exited_re match a single line The current inferior_exited_re regexp contains a '.*': ... set inferior_exited_re "(?:\\\[Inferior \[0-9\]+ \\(.*\\) exited)" ... This means that while matching a single line: ... $ tclsh % set re "(?:\\\[Inferior \[0-9\]+ \\(.*\\) exited)" (?:\[Inferior [0-9]+ \(.*\) exited) % set line "\[Inferior 1 (process 33) exited\]\n" [Inferior 1 (process 33) exited] % regexp $re $line 1 ... it also matches more than one line: ... $ tclsh % set re "(?:\\\[Inferior \[0-9\]+ \\(.*\\) exited)" (?:\[Inferior [0-9]+ \(.*\) exited) % set line "\[Inferior 1 (process 33) exited\]\n\[Inferior 2 (process 44) exited\]\n" [Inferior 1 (process 33) exited] [Inferior 2 (process 44) exited] % regexp $re $line 1 ... Fix this by using "\[^\n\r]*" instead of ".*". Build and reg-tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-02-01 Tom de Vries * lib/gdb.exp (inferior_exited_re): Use "\[^\n\r]*" instead of ".*". Change-Id: Id7b1dcecd8c7fda3d1ab34b4fa1364d301748333 --- M gdb/testsuite/lib/gdb.exp 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 25bed76..14d752b 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\]+ \\(\[^\n\r]*\\) exited)" # A regular expression that matches a value history number. # E.g., $1, $2, etc.