delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/04/05/00:16:18

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:date:from:to:subject:message-id:references
:mime-version:content-type:in-reply-to; q=dns; s=default; b=kstO
bR+jAI0KZd9ve29QpW/aL2t8F/u0RC3XHlHOL+wJIulJIl9igOHot3QNyPXLHoDt
/5sUJ9xZdSzOje+6BNNlF3RluzsgNjp2GLN1QAowIhQe8w7Nph5iBz7IdsH9ddai
pEk5nD3oeustKRmvMxk6bLJv86h4nQAIqKhiqSY=
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:date:from:to:subject:message-id:references
:mime-version:content-type:in-reply-to; s=default; bh=EnFg1ZGRbU
z9OwhIlHyupDiBDrY=; b=hQnVr4cRRHX31qv0cBnH3aemTyREAIqY+ckHlCSnhr
W1Ix3lHyah9itdoHgS5AefFfhdjcMBKJVY5j9TS5LwVDBOEiAXLwWL+cWiXgNMvY
sYNq95GugXunZ73+D7fJA7XEDMFBhTbCWsfdKTLe/DkyTakZCL3peDgtWtpC/GHy
g=
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=0.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2
X-HELO: mail110.syd.optusnet.com.au
Date: Sat, 5 Apr 2014 15:15:14 +1100
From: Duncan Roe <duncan_roe AT acslink DOT net DOT au>
To: cygwin AT cygwin DOT com
Subject: WORKED AROUND Re: No I/O redirection under GDB
Message-ID: <20140405041514.GB8268@dimstar.local.net>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20140405022905 DOT GA8268 AT dimstar DOT local DOT net> <533F6FAC DOT 5060200 AT cs DOT umass DOT edu>
MIME-Version: 1.0
In-Reply-To: <533F6FAC.5060200@cs.umass.edu>
User-Agent: Mutt/1.5.22 (2013-10-16)
X-Optus-CM-Score: 0
X-Optus-CM-Analysis: v=2.1 cv=eojmkOZX c=1 sm=1 tr=0 a=+cDhJlqnNvz9E7c5l3ERGg==:117 a=+cDhJlqnNvz9E7c5l3ERGg==:17 a=y26AOypDAAAA:8 a=PO7r1zJSAAAA:8 a=M1kyBYkWWGkA:10 a=658ZFupbWLAA:10 a=kj9zAlcOel0A:10 a=iaFubHWvAAAA:8 a=CCpqsmhAAAAA:8 a=a_q1BnTq-rlBix489MAA:9 a=CjuIK1q_8ugA:10 a=Ox6Cc_31imIA:10 a=lXIItB0-HAIA:10
X-IsSubscribed: yes

On Fri, Apr 04, 2014 at 10:51:24PM -0400, Eliot Moss wrote:
> 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
>
Thanks for replying.

Sorry but your suggested command line doesn't help: I need gdb command i/o in
one screen and program i/o in another.

The set inferior-tty command documented in the link you posted *very nearly*
gave me what I was after. Having updated my startup script to use it, I now find
that I can't use Control-C to interrupt the session: it's ignored in the gdb
window and causes catastrophic gdb failure in the application window (as well as
waking the shell from sleep). It's better than nothing I guess.

So, I'm back to needing i/o redirection in the run command (as also documented
in your link). It works in Linux.

Cheers ... Duncan.

--
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