From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18486 invoked by alias); 21 Mar 2016 17:12:25 -0000 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 Received: (qmail 18472 invoked by uid 89); 21 Mar 2016 17:12:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1934, starters, sockets, online X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 21 Mar 2016 17:12:14 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ai3N8-0004mD-G8 for gdb-patches@sourceware.org; Mon, 21 Mar 2016 13:12:12 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59763) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ai3N8-0004m9-Cc; Mon, 21 Mar 2016 13:12:06 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2882 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1ai3N7-0007CO-Li; Mon, 21 Mar 2016 13:12:06 -0400 Date: Mon, 21 Mar 2016 17:12:00 -0000 Message-Id: <83r3f369io.fsf@gnu.org> From: Eli Zaretskii To: Pedro Alves CC: gdb-patches@sourceware.org In-reply-to: <56F02689.2050503@redhat.com> (message from Pedro Alves on Mon, 21 Mar 2016 16:51:21 +0000) Subject: Re: [PATCH v2 24/25] Add new command to create extra console/mi UI channels Reply-to: Eli Zaretskii References: <1458573675-15478-1-git-send-email-palves@redhat.com> <1458573675-15478-25-git-send-email-palves@redhat.com> <83twjz6bex.fsf@gnu.org> <56F02689.2050503@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg00418.txt.bz2 > Cc: gdb-patches@sourceware.org > From: Pedro Alves > Date: Mon, 21 Mar 2016 16:51:21 +0000 > > > Shouldn't this (and other related) code be conditional of PTYs being > > supported? Otherwise, this is just useless baggage, right? > > Actually this should all work on Windows too, for example. Are you sure? The code does this, for example: > +static FILE * > +open_stream (const char *name) > +{ > + int fd; > + > + fd = open (name, O_RDWR | O_NOCTTY); > + if (fd < 0) > + perror_with_name (_("opening terminal failed")); > + > + return fdopen (fd, "w+"); > +} How do you expect this to work on Windows? For starters, O_NOCTTY is not supported. And what would you use for 'name' here? More importantly, each Windows process can have only one console at a time, AFAIK. Am I missing something? > MI doesn't really need a PTY, so even though currently the command's > online help and git logs say usage is "new-ui INTERP TTY", that TTY part > could actually be the name of any bidirectional stream. > > E.g., it could be a bidi unix domain socket, on Linux, or on Windows, > I think it should work to pass a console name, or a bidirectional > named pipe path, though I haven't tried it. There are no Unix domain sockets on Windows, AFAIK. As for a console name, see above. > If necessary, it would also be easy to extend the command to support > separate streams for in/out/err, like, e.g.: > > (gdb) new-ui INTERP IN OUT ERR > > And then it'd be possible to open a new MI channel through > unidirectional named pipes, regular files, etc. too. But doesn't readline need a console-compatible device? PTYs pass the isatty test, but pipes and regular files fail it, so will readline at all work? I have a dreadful feeling that I'm missing something very important here, because I'm sure I don't tell anything you don't already know.