From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11575 invoked by alias); 17 Aug 2011 08:26:56 -0000 Received: (qmail 11538 invoked by uid 22791); 17 Aug 2011 08:26:53 -0000 X-SWARE-Spam-Status: No, hits=-2.5 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-ew0-f41.google.com (HELO mail-ew0-f41.google.com) (209.85.215.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 17 Aug 2011 08:26:39 +0000 Received: by ewy9 with SMTP id 9so329253ewy.0 for ; Wed, 17 Aug 2011 01:26:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.213.3.19 with SMTP id 19mr270958ebl.36.1313569596519; Wed, 17 Aug 2011 01:26:36 -0700 (PDT) Received: by 10.213.33.142 with HTTP; Wed, 17 Aug 2011 01:26:36 -0700 (PDT) In-Reply-To: <20110816173009.GA12303@host1.jankratochvil.net> References: <20110814121407.GA29236@host1.jankratochvil.net> <83y5ywulun.fsf@gnu.org> <20110814170136.GA26819@host1.jankratochvil.net> <83sjp3vkze.fsf@gnu.org> <20110814195523.GA7588@host1.jankratochvil.net> <83bovptr1u.fsf@gnu.org> <20110816173009.GA12303@host1.jankratochvil.net> Date: Wed, 17 Aug 2011 08:26:00 -0000 Message-ID: Subject: Re: [PATCH] An implementation of pipe to make I/O communication between gdb and shell. [MinGW question] From: Abhijit Halder To: Jan Kratochvil Cc: Eli Zaretskii , sergiodj@redhat.com, tromey@redhat.com, pedro@codesourcery.com, gdb-patches@sourceware.org Content-Type: multipart/mixed; boundary=0015174c162830355604aaaf41ca 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-08/txt/msg00337.txt.bz2 --0015174c162830355604aaaf41ca Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-length: 2826 On Tue, Aug 16, 2011 at 11:00 PM, Jan Kratochvil wrote: > On Tue, 16 Aug 2011 19:25:21 +0200, Abhijit Halder wrote: >> --- src/gdb/testsuite/gdb.base/pipe.c 2011-08-16 22:37:37.785351001 +0530 >> +++ dst/gdb/testsuite/gdb.base/pipe.c 2011-08-16 22:32:40.213350709 +0530 > > There isn't needed any .c file. > >> diff -rup src/gdb/testsuite/gdb.base/pipe.exp dst/gdb/testsuite/gdb.base= /pipe.exp >> --- 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-16 22:35:34.= 117356781 +0530 >> @@ -0,0 +1,49 @@ >> +# =A0 Copyright 2011 Free Software Foundation, Inc. >> + >> +# This program is free software; you can redistribute it and/or modify >> +# it under the terms of the GNU General Public License as published by >> +# the Free Software Foundation; either version 3 of the License, or >> +# (at your option) any later version. >> +# >> +# This program is distributed in the hope that it will be useful, >> +# but WITHOUT ANY WARRANTY; without even the implied warranty of >> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. =A0See the >> +# GNU General Public License for more details. >> +# >> +# You should have received a copy of the GNU General Public License >> +# along with this program. =A0If not, see . >> + >> +# >> +# test gdb pipe commands >> +# >> + >> +if $tracelevel then { >> + =A0 =A0strace $tracelevel >> +} > > This is rather redundant, please see: > =A0 =A0 =A0 =A0http://sourceware.org/gdb/wiki/GDBTestcaseCookbook > > >> + >> +set testfile "pipe" >> +set srcfile ${testfile}.c >> +set binfile ${objdir}/${subdir}/${testfile} >> +if =A0{ [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" exec= utable {debug}] !=3D "" } { >> + =A0 =A0untested pipe.exp >> + =A0 =A0return -1 >> +} >> + >> +if [get_compiler_info ${binfile}] { >> + =A0 =A0return -1 >> +} >> + >> +gdb_exit >> +gdb_start >> +gdb_reinitialize_dir ${srcdir}/${subdir} >> +gdb_load ${binfile} >> + >> +set end_main [gdb_get_line_number " end main " $srcfile] >> + >> +if ![runto_main] then { >> + =A0 =A0fail "Can't run to main" >> + =A0 =A0return 0 >> +} > > Just keep gdb_exit and gdb_start from all of this. > > >> + >> +gdb_test "pipe | bt | grep \"main\"" "\#0.*main.*().*at.*${srcfile}:${e= nd_main}" >> + > > I would not use `bt' which is very complicated and for the `pipe' > functionality arbitrary command - such as `print' - is enough. > > But it is more important to test various many cases of pipe, such as vari= ous > non-standard delimiters besides "|", also the redirection of shell output, > using pipe in the shell part (double/triple pipe), testing the error cases > that they are caught correctly etc. > > > Thanks, > Jan > Here is the correction. --0015174c162830355604aaaf41ca Content-Type: text/x-patch; charset=US-ASCII; name="gdb-pipe-command-testsuite-corrected.patch" Content-Disposition: attachment; filename="gdb-pipe-command-testsuite-corrected.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_grg1dkxn0 Content-length: 2424 ZGlmZiAtcnVwIHNyYy9nZGIvdGVzdHN1aXRlL2dkYi5iYXNlL3BpcGUuZXhw IGRzdC9nZGIvdGVzdHN1aXRlL2dkYi5iYXNlL3BpcGUuZXhwCi0tLSBzcmMv Z2RiL3Rlc3RzdWl0ZS9nZGIuYmFzZS9waXBlLmV4cAkyMDExLTA4LTE2IDIy OjM3OjQ1Ljk2OTM1MTExOSArMDUzMAorKysgZHN0L2dkYi90ZXN0c3VpdGUv Z2RiLmJhc2UvcGlwZS5leHAJMjAxMS0wOC0xNyAxMzo0OToyNi4xOTUzODMw MDEgKzA1MzAKQEAgLTAsMCArMSwzNyBAQAorIyAgIENvcHlyaWdodCAyMDEx IEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbiwgSW5jLgorCisjIFRoaXMgcHJv Z3JhbSBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBp dCBhbmQvb3Ig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