From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11420 invoked by alias); 3 Sep 2011 09:21:36 -0000 Received: (qmail 11411 invoked by uid 22791); 3 Sep 2011 09:21:35 -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; Sat, 03 Sep 2011 09:21:21 +0000 Received: by wwe32 with SMTP id 32so3147474wwe.12 for ; Sat, 03 Sep 2011 02:21:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.1.200 with SMTP id 50mr500290wed.33.1315041679592; Sat, 03 Sep 2011 02:21:19 -0700 (PDT) Received: by 10.216.22.75 with HTTP; Sat, 3 Sep 2011 02:21:19 -0700 (PDT) In-Reply-To: <20110902204454.GA23897@host1.jankratochvil.net> References: <20110902204454.GA23897@host1.jankratochvil.net> Date: Sat, 03 Sep 2011 09:32: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/msg00048.txt.bz2 On Sat, Sep 3, 2011 at 2:14 AM, Jan Kratochvil wrote: > On Wed, 31 Aug 2011 17:09:30 +0200, Abhijit Halder wrote: >> --- src/gdb/pipe.c =A0 =A02011-07-29 15:15:26.078048517 +0530 >> +++ dst/gdb/pipe.c =A0 =A02011-08-29 18:50:14.000000000 +0530 > [...] >> +#if defined(__MINGW32__) > -> > =A0+#if defined (__MINGW32__) > Sorry somehow I missed this. I will correct this. > Not GNU Coding Style compliant although it is so common in GDB I do not m= ind > (already commented before). > > >> +# define SHELL "cmd.exe" >> +# define OPTION_TO_SHELL "/c" >> +#else >> +# define SHELL "/bin/sh" >> +# define OPTION_TO_SHELL "-c" >> +#endif > [...] >> --- src/gdb/testsuite/gdb.base/pipe.exp =A0 =A0 =A0 2011-08-16 22:37:45.= 969351119 +0530 >> +++ dst/gdb/testsuite/gdb.base/pipe.exp =A0 =A0 =A0 2011-08-25 03:10:05.= 000000000 +0530 >> @@ -0,0 +1,52 @@ > [...] >> + =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. > You have opposite order of the pattern vs. string in the `string match' > otherwise. > > >> + =A0 =A0 fail $test >> + =A0 =A0} else { >> + =A0 =A0 pass $test >> + =A0 =A0} >> +} > > Thanks, Abhijit Halder