From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25289 invoked by alias); 4 Sep 2011 14:52:56 -0000 Received: (qmail 25280 invoked by uid 22791); 4 Sep 2011 14:52:55 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 04 Sep 2011 14:52:35 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p84EqZdw023271 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 4 Sep 2011 10:52:35 -0400 Received: from host1.jankratochvil.net (ovpn-116-38.ams2.redhat.com [10.36.116.38]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p84EqXjX013836 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 4 Sep 2011 10:52:34 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p84EqWDS022129; Sun, 4 Sep 2011 16:52:32 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p84EqVfg022125; Sun, 4 Sep 2011 16:52:31 +0200 Date: Sun, 04 Sep 2011 15:05:00 -0000 From: Jan Kratochvil To: Abhijit Halder Cc: gdb-patches@sourceware.org Subject: Re: [PATCH][TEST-CASE][DOC] Implementation of pipe to pass GDB's command output to a shell command. Message-ID: <20110904145231.GA18986@host1.jankratochvil.net> References: <20110902204454.GA23897@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-09/txt/msg00063.txt.bz2 On Sat, 03 Sep 2011 11:21:19 +0200, Abhijit Halder wrote: > >> +    regsub -all {\$[0-9]+} $fdata {} pattern > >> +    if ![string match $pattern " = 120 'x'\n"] then { > > > > Instead of regsub + string match just: > >    if ![string match "* = 120 'x'\n" $fdata] then { > > > The intention was to eliminate only numeric patterns here. > Instead if I used "if ![string match "* = 120 'x'\n" $fdata] then {" > following pattern will also match: > $junk = 120 'x' > that I did not want. It is currently a common practice to match this kind of pattern just from ` = ' upwards such as: gdb_test "p callme ()" " = 42" etc. everywhere in the testsuite. But if you want to match the initial $number part such as in gdb_test "print test1.test" "\\$\[0-9\]* = true" "simple object, const bool" then it is more simple by: if ![regexp {^\$[0-9]+ = 120 'x'\n$} $fdata] then { Thanks, Jan