From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7127 invoked by alias); 22 Feb 2005 16:35:52 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 6603 invoked from network); 22 Feb 2005 16:35:25 -0000 Received: from unknown (HELO hub.ott.qnx.com) (209.226.137.76) by sourceware.org with SMTP; 22 Feb 2005 16:35:25 -0000 Received: from smtp.ott.qnx.com (smtp.ott.qnx.com [10.0.2.158]) by hub.ott.qnx.com (8.9.3/8.9.3) with ESMTP id LAA06186 for ; Tue, 22 Feb 2005 11:37:24 -0500 Received: (from alain@localhost) by smtp.ott.qnx.com (8.8.8/8.6.12) with UUCP id LAA03126 for gdb-patches@sources.redhat.com; Tue, 22 Feb 2005 11:35:24 -0500 Message-Id: <200502221635.LAA03126@smtp.ott.qnx.com> Subject: Re: MI testsuite improvements To: cagney@gnu.org (Andrew Cagney) Date: Tue, 22 Feb 2005 23:24:00 -0000 From: "Alain Magloire" Cc: bob@brasko.net (Bob Rossi), alain@qnx.com (Alain Magloire), nickrob@snap.net.nz (Nick Roberts), gdb-patches@sources.redhat.com In-Reply-To: <4218AA55.7080304@gnu.org> from "Andrew Cagney" at Feb 20, 2005 10:18:45 AM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2005-02/txt/msg00242.txt.bz2 > > Hi Alain, > > Bonjour, > > There are 2 different ideas being suggested, > > - To create an mi command, that does the same thing as the console > > 'tty' command, and each of these internally can be wrappers around > > some data that can be accessed with GDB's set/show mechanism. For > > example, > > -mi-set-tty /dev/pts/1 (mi command) > > tty /dev/pts/1 (console command) > > set tty /dev/pts/1 (set command) > > and I belive: > set tty > I need to confirm it but it appears that there's an ``optional > filename'' class of variable (grep for filename_completer in the sources). > > If the last is implemented, an existing MI command should already let > you set/show the variable. Ok, so far. > > - The second idea was to have GDB internally create a pty. That would > > result in a master and slave side. Neither of these are important, > > AFAIK, only the slavename (file name of the terminal created, > > ie. /dev/pts/1) is important. For example, here is what could > > happen > > 1. The user asks GDB to open a new pty and the name is given back > > -mi-create-pty > > /dev/pts/1 > > 2. The user asks GDB to use that pty for the inferior > > -mi-set-tty /dev/pts/1 > > 3. The user opens /dev/pts/1 in there own program to read the > > output of the inferior. > > 4. The user asks GDB to close the device > > -mi-destroy-pty /dev/pts/1 > > > > Either way, it will probably be a while before I have time to work on > > the second task, since I'm already swamped trying to validate the MI > > testsuite with a syntax checker and changing the grammar to match > > what GDB actually outputs. This is not clear to me ... one more scenario so you can see from my point of view 8-) As you pointed out, when creating the pseudo pty we have a master and slave side and both should be important : (gdb) -mi-create-pty ^done,pty={master="/dev/ptyp0",slave="/dev/ptyTf"} (gdb) The master is given to gdb to set std{in,out,err} of the inferior after forking (gdb) -mi-set-tty /dev/ptyp0 ^done (gdb) -exec-run ^running And the slave is use internally by the front end to read/write when communicating with the inferior. TTY is good for a few things: - allow to separate the inferior stream from the mi protocol - some programs need a real pty to work i.e. passwd, ... - correct behaviour of buffering, stdio will be line buffer we have a lot of PR from folks asking after doing a next on printf("print this\n"); why is the pring not showing up.