From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11650 invoked by alias); 5 Sep 2011 11:53:56 -0000 Received: (qmail 11637 invoked by uid 22791); 5 Sep 2011 11:53:55 -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-wy0-f169.google.com (HELO mail-wy0-f169.google.com) (74.125.82.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 05 Sep 2011 11:53:39 +0000 Received: by wyi11 with SMTP id 11so4262488wyi.0 for ; Mon, 05 Sep 2011 04:53:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.184.146 with SMTP id s18mr4169120wem.3.1315223617213; Mon, 05 Sep 2011 04:53:37 -0700 (PDT) Received: by 10.216.22.75 with HTTP; Mon, 5 Sep 2011 04:53:37 -0700 (PDT) In-Reply-To: References: <20110902204454.GA23897@host1.jankratochvil.net> <20110904145231.GA18986@host1.jankratochvil.net> Date: Mon, 05 Sep 2011 11:56: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/msg00078.txt.bz2 On Sun, Sep 4, 2011 at 8:35 PM, Abhijit Halder wrote: > 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 >> > ***************************************************************************= ****** Following invalid c-statements are getting parsed successfully: 1. int(*) 2. int*(*) 3. int(*)()() 4. int*(*)()() 5. int(*)()()() 6. int*(*)()()() 7. int*(*)()[]() ....etc. Following valid c-statement failed to be parsed: 1. int(**)() Probably a few more may appear......... I am putting all this as the test-cases. Thanks, Abhijit Halder 2. int*(**)() 3.