delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/04/04/22:51:45

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:reply-to:mime-version:to
:subject:references:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=h2aCWlPG86e8gemH
+/1317MagnV0WxcSJZYoF9ErAFzMo/jKRvpSAEXT9CjPs95SfSeF4RZEAomVNvbs
PMHgliitFVghnrjMMty401KP/E0mL0J147k4VD9ZoQypgHyMNY/OZbnlRN6+O6Y5
t1W9yrGPo3C8xRkECSw6epXHyVA=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:reply-to:mime-version:to
:subject:references:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=0xwDGENX2jItEyCLuFCTTc
2W/G0=; b=aYUD71TQNOUtSLZfZ2WT+qtXSqWDiLmc56a67Gs3QRfMrlTCUIwTpS
NGb2j4tLYzRQha0A7OHBhbtI9yN6a1e7HlL55sF0Zus4QjXT22Lg2R/XqHmncbf2
6iOgAJfcKaxna9mnIw+SjnF26IUD3HMC8je1eOIu7eTzsSy+/o9bA=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD autolearn=ham version=3.3.2
X-HELO: csmail.cs.umass.edu
Message-ID: <533F6FAC.5060200@cs.umass.edu>
Date: Fri, 04 Apr 2014 22:51:24 -0400
From: Eliot Moss <moss AT cs DOT umass DOT edu>
Reply-To: moss AT cs DOT umass DOT edu
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: No I/O redirection under GDB
References: <20140405022905 DOT GA8268 AT dimstar DOT local DOT net>
In-Reply-To: <20140405022905.GA8268@dimstar.local.net>
X-IsSubscribed: yes

On 4/4/2014 10:29 PM, Duncan Roe wrote:
> I just found that gdb's "run" command doesn't action redirection (e.g. run
> </dev/pty2 >/dev/pty2 2>&1, where the shell on /dev/pty2 is doing a long sleep).
> Instead, the invoked program gets the redirections as command line arguments.
>
> Looking through the archives, I found
> https://sourceware.org/ml/cygwin/1999-04/msg00355.html documenting this
> behaviour. Chris Faylor commented at the time that fixing it was more trouble
> than it appeared.
>
> That was 15 years ago - has anything changed since? Anyone up for this or should
> I have a go? I *could* simply make my target do the redirection itself, but that
> doesn't help anyone else. OTOH if changing gdb really *is* that hard, maybe I
> should just change my program anyway.
>
> Any advice welcomed,

I think this is the intended design (see:
https://sourceware.org/gdb/current/onlinedocs/gdb/Input_002fOutput.html#Input_002fOutput
).  If you want *gdb's* input and output redirected, I would think you want to invoke
gdb with I/O redirection on the command line, as in:

gdb foo < infile > outfile

Regards -- Eliot Moss

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019