From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6173 invoked by alias); 4 Aug 2011 09:29:58 -0000 Received: (qmail 6161 invoked by uid 22791); 4 Aug 2011 09:29:56 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 04 Aug 2011 09:29:42 +0000 Received: (qmail 18284 invoked from network); 4 Aug 2011 09:29:42 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 4 Aug 2011 09:29:42 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [PATCH] An implementation of pipe to make I/O communication between gdb and shell. Date: Thu, 04 Aug 2011 09:29:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-8-generic; KDE/4.6.2; x86_64; ; ) Cc: Abhijit Halder , Sergio Durigan Junior , Jan Kratochvil References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201108041029.37721.pedro@codesourcery.com> 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/msg00065.txt.bz2 On Thursday 04 August 2011 08:51:14, Abhijit Halder wrote: > + fstream = gdb_modify_io (gdb_stdio, pstream); > + execute_command (pipe->gdb_cmd, from_tty); > + pstream = gdb_modify_io (gdb_stdio, fstream); Looks like this leaves gdb_stdio in an inconsistent state if execute_command throws an error. Do you really need the new gdb_modify_io function? Can't ui_out_redirect (and stdio_file_new perhaps) do the job? > + pipe->handle = popen (pipe->shell_cmd, pipe->mode); I'm not sure that'll build on all supported hosts. I think on Windows that may require use of _popen instead. "struct pipe_t" sounds like a recipe for system namespace colision (and _t is reserved for posix, though we have some precedent for abusing it), and is easily confused with the ser*.c pipe machinery. Can you find an alternative name for the struct please? Perhaps struct pipe_cmd_state. -- Pedro Alves