From patchwork Thu Aug 8 09:21:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 34003 Received: (qmail 35310 invoked by alias); 8 Aug 2019 09:21:27 -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 35302 invoked by uid 89); 8 Aug 2019 09:21:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1626 X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 08 Aug 2019 09:21:26 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id EA5BBAEFF; Thu, 8 Aug 2019 09:21:23 +0000 (UTC) Date: Thu, 8 Aug 2019 11:21:22 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH][gdb/testsuite] Fix gdb.tui/basic.exp with check-read1 Message-ID: <20190808092120.GA20911@delia> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-IsSubscribed: yes Hi, With gdb.tui/basic.exp and check-read1, we run into (using -v for verbose log): ... ^[[0+++ _csi_0 <<<>>> ERROR: (DejaGnu) proc "_csi_0" does not exist. ... In contrast, without check-read1, we have: ... ^[[0;10m+++ _csi_m <<<0;10>>> ... The problem is that this regexp in _accept: ... -re "^\x1b\\\[(\[0-9;\]*)(\[0-9a-zA-Z@\])" { ... while matching the longer sequence '^[' '[' '0' ';' '1' '0' 'm', also matches the shorter sequence '^[' '[' '0'. The regexp attempts to match a CSI (Control Sequence Introducer) sequence, and the final byte of such a sequence cannot be a digit. Fix the regexp accordingly: ... - -re "^\x1b\\\[(\[0-9;\]*)(\[0-9a-zA-Z@\])" { + -re "^\x1b\\\[(\[0-9;\]*)(\[a-zA-Z@\])" { ... Tested on x86_64-linux. OK for trunk? Thanks, - Tom [gdb/testsuite] Fix gdb.tui/basic.exp with check-read1 gdb/testsuite/ChangeLog: 2019-08-08 Tom de Vries PR testsuite/24862 * lib/tuiterm.exp (_accept): Fix CSI regexp. --- gdb/testsuite/lib/tuiterm.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/testsuite/lib/tuiterm.exp b/gdb/testsuite/lib/tuiterm.exp index d94fd431d8..cd728156fc 100644 --- a/gdb/testsuite/lib/tuiterm.exp +++ b/gdb/testsuite/lib/tuiterm.exp @@ -392,7 +392,7 @@ namespace eval Term { verbose "+++ unsupported escape" error "unsupported escape" } - -re "^\x1b\\\[(\[0-9;\]*)(\[0-9a-zA-Z@\])" { + -re "^\x1b\\\[(\[0-9;\]*)(\[a-zA-Z@\])" { set cmd $expect_out(2,string) set params [split $expect_out(1,string) ";"] verbose "+++ _csi_$cmd <<<$expect_out(1,string)>>>"