From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28755 invoked by alias); 16 Aug 2011 17:30:43 -0000 Received: (qmail 28744 invoked by uid 22791); 16 Aug 2011 17:30:42 -0000 X-SWARE-Spam-Status: No, hits=-7.0 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; Tue, 16 Aug 2011 17:30:25 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7GHUEAO005450 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 16 Aug 2011 13:30:14 -0400 Received: from host1.jankratochvil.net (ovpn-116-17.ams2.redhat.com [10.36.116.17]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p7GHUCvB031377 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 16 Aug 2011 13:30:13 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p7GHUB0V012424; Tue, 16 Aug 2011 19:30:11 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p7GHUAKH012423; Tue, 16 Aug 2011 19:30:10 +0200 Date: Tue, 16 Aug 2011 17:30:00 -0000 From: Jan Kratochvil To: Abhijit Halder Cc: Eli Zaretskii , sergiodj@redhat.com, tromey@redhat.com, pedro@codesourcery.com, gdb-patches@sourceware.org Subject: Re: [PATCH] An implementation of pipe to make I/O communication between gdb and shell. [MinGW question] Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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-08/txt/msg00336.txt.bz2 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 2011-08-16 22:37:45.969351119 +0530 > +++ dst/gdb/testsuite/gdb.base/pipe.exp 2011-08-16 22:35:34.117356781 +0530 > @@ -0,0 +1,49 @@ > +# 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. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program. If not, see . > + > +# > +# test gdb pipe commands > +# > + > +if $tracelevel then { > + strace $tracelevel > +} This is rather redundant, please see: http://sourceware.org/gdb/wiki/GDBTestcaseCookbook > + > +set testfile "pipe" > +set srcfile ${testfile}.c > +set binfile ${objdir}/${subdir}/${testfile} > +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { > + untested pipe.exp > + return -1 > +} > + > +if [get_compiler_info ${binfile}] { > + return -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 { > + fail "Can't run to main" > + return 0 > +} Just keep gdb_exit and gdb_start from all of this. > + > +gdb_test "pipe | bt | grep \"main\"" "\#0.*main.*().*at.*${srcfile}:${end_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 various 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