This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: MI testsuite improvements
- From: Bob Rossi <bob at brasko dot net>
- To: Alain Magloire <alain at qnx dot com>
- Cc: Andrew Cagney <cagney at gnu dot org>, Nick Roberts <nickrob at snap dot net dot nz>,gdb-patches at sources dot redhat dot com
- Date: Mon, 28 Feb 2005 21:40:37 -0500
- Subject: Re: MI testsuite improvements
- References: <4218AA55.7080304@gnu.org> <200502221635.LAA07270@smtp.ott.qnx.com>
> > > - 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
I didn't even know you could get a device name for the master side. If
you have the master fd, you can get the slave name via ptsname, how do
you get the master device name?
> And the slave is use internally by the front end to read/write when
> communicating with the inferior.
I have been giving GDB the slave name for the inferior program. Then I
also internally read/write using the slave name. Is this wrong? Why are
we using different methods?
Thanks,
Bob Rossi