From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27193 invoked by alias); 4 Sep 2011 15:05:55 -0000 Received: (qmail 27184 invoked by uid 22791); 4 Sep 2011 15:05:54 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-ww0-f43.google.com (HELO mail-ww0-f43.google.com) (74.125.82.43) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 04 Sep 2011 15:05:41 +0000 Received: by wwe32 with SMTP id 32so3756301wwe.12 for ; Sun, 04 Sep 2011 08:05:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.184.146 with SMTP id s18mr3235550wem.3.1315148739543; Sun, 04 Sep 2011 08:05:39 -0700 (PDT) Received: by 10.216.22.75 with HTTP; Sun, 4 Sep 2011 08:05:39 -0700 (PDT) In-Reply-To: <20110904145231.GA18986@host1.jankratochvil.net> References: <20110902204454.GA23897@host1.jankratochvil.net> <20110904145231.GA18986@host1.jankratochvil.net> Date: Sun, 04 Sep 2011 17:05:00 -0000 Message-ID: Subject: Re: [PATCH][TEST-CASE][DOC] Implementation of pipe to pass GDB's command output to a shell command. From: Abhijit Halder To: Jan Kratochvil Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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/msg00064.txt.bz2 On Sun, Sep 4, 2011 at 8:22 PM, Jan Kratochvil wrote: > On Sat, 03 Sep 2011 11:21:19 +0200, Abhijit Halder wrote: >> >> + =A0 =A0regsub -all {\$[0-9]+} $fdata {} pattern >> >> + =A0 =A0if ![string match $pattern " =3D 120 'x'\n"] then { >> > >> > Instead of regsub + string match just: >> > =A0 =A0if ![string match "* =3D 120 'x'\n" $fdata] then { >> > >> The intention was to eliminate only numeric patterns here. >> Instead if I used "if ![string match "* =3D 120 'x'\n" $fdata] then {" >> following pattern will also match: >> $junk =3D 120 'x' >> that I did not want. > > It is currently a common practice to match this kind of pattern just from > ` =3D ' upwards such as: > gdb_test "p callme ()" " =3D 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\]* =3D true" "simple object, const = bool" > then it is more simple by: > =A0 =A0if ![regexp {^\$[0-9]+ =3D 120 'x'\n$} $fdata] then { > Got it. Correcting the same in the next patch. > > Thanks, > Jan >