public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* separating gdb & inferior output
@ 2004-08-24 16:12 Bob Rossi
  2004-08-24 19:05 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Bob Rossi @ 2004-08-24 16:12 UTC (permalink / raw)
  To: gdb

Hi,

Is there a better way to separate GDB's and the inferior's output
besides using the tty command?

I have the feeling the tty command does not port properly everywhere
that GDB does (mingw, cygwin). I've personally had problems with it on
some version of Windows with cygwin. Besides, figuring out how to open a
tty on different machines is a real pain.

Is there a better, more portable way, to accomplish the same task?
I was thinking of having GDB output it's output to a UNIX or TCP/IP
port. How about a FIFO(portable?)? Any other ideas? 

I have a feeling this has been brought up before.

Thanks,
Bob Rossi

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: separating gdb & inferior output
  2004-08-24 16:12 separating gdb & inferior output Bob Rossi
@ 2004-08-24 19:05 ` Eli Zaretskii
  2004-08-24 19:09   ` Bob Rossi
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2004-08-24 19:05 UTC (permalink / raw)
  To: Bob Rossi; +Cc: gdb

> Date: Tue, 24 Aug 2004 12:11:47 -0400
> From: Bob Rossi <bob@brasko.net>
> 
> I have the feeling the tty command does not port properly everywhere
> that GDB does (mingw, cygwin). I've personally had problems with it on
> some version of Windows with cygwin. Besides, figuring out how to open a
> tty on different machines is a real pain.
> 
> Is there a better, more portable way, to accomplish the same task?

What can be more portable than file descriptor redirection?  Even
MS-DOS supports it.

> I was thinking of having GDB output it's output to a UNIX or TCP/IP
> port. How about a FIFO(portable?)? Any other ideas? 

Both are less portable than redirection, IMHO.  FIFOs are
Unix-specific, and ports will not work on a system without a network
interface.

Perhaps you could state what are the problems with `tty'?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: separating gdb & inferior output
  2004-08-24 19:05 ` Eli Zaretskii
@ 2004-08-24 19:09   ` Bob Rossi
  2004-08-25  4:07     ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Bob Rossi @ 2004-08-24 19:09 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb

On Tue, Aug 24, 2004 at 10:00:11PM +0300, Eli Zaretskii wrote:
> > Date: Tue, 24 Aug 2004 12:11:47 -0400
> > From: Bob Rossi <bob@brasko.net>
> > 
> > I have the feeling the tty command does not port properly everywhere
> > that GDB does (mingw, cygwin). I've personally had problems with it on
> > some version of Windows with cygwin. Besides, figuring out how to open a
> > tty on different machines is a real pain.
> > 
> > Is there a better, more portable way, to accomplish the same task?
> 
> What can be more portable than file descriptor redirection?  Even
> MS-DOS supports it.
> 
> > I was thinking of having GDB output it's output to a UNIX or TCP/IP
> > port. How about a FIFO(portable?)? Any other ideas? 
> 
> Both are less portable than redirection, IMHO.  FIFOs are
> Unix-specific, and ports will not work on a system without a network
> interface.
> 
> Perhaps you could state what are the problems with `tty'?

O, you need to actually get a new tty. Windows doesn't have the concept
of a tty. File descriptor redirection is fine. Maybe we could have
something like

   gdb --i=mi --out_fd=n
where n is the descriptor you plan on reading from GDB.

What does it mean to open a 'tty' on a windows platform, or some other
non-unix platform?

Thanks,
Bob Rossi

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: separating gdb & inferior output
  2004-08-24 19:09   ` Bob Rossi
@ 2004-08-25  4:07     ` Eli Zaretskii
  2004-08-25 11:41       ` Bob Rossi
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2004-08-25  4:07 UTC (permalink / raw)
  To: Bob Rossi; +Cc: gdb

> Date: Tue, 24 Aug 2004 15:09:12 -0400
> From: Bob Rossi <bob@brasko.net>
> Cc: gdb@sources.redhat.com
> 
> > Perhaps you could state what are the problems with `tty'?
> 
> O, you need to actually get a new tty.

Sorry, I still don't get it: I know what the `tty' command does, but I
don't understand what is its problem on non-Unix platforms.  I don't
see anything dubious in the code that implements the command.

> Windows doesn't have the concept of a tty.

Of course, it does.

> File descriptor redirection is fine.

And that's exactly what win32-nat.c does, please take a look.

> Maybe we could have something like
> 
>    gdb --i=mi --out_fd=n
> where n is the descriptor you plan on reading from GDB.

How is this different from what GDB already does?

> What does it mean to open a 'tty' on a windows platform, or some other
> non-unix platform?

Again, see win32-nat.c (search for "inferior_io_terminal").

I'm afraid I'm missing something.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: separating gdb & inferior output
  2004-08-25  4:07     ` Eli Zaretskii
@ 2004-08-25 11:41       ` Bob Rossi
  2004-08-25 18:34         ` Eli Zaretskii
  2004-08-30 19:23         ` Christopher Faylor
  0 siblings, 2 replies; 7+ messages in thread
From: Bob Rossi @ 2004-08-25 11:41 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb

On Wed, Aug 25, 2004 at 07:01:32AM +0300, Eli Zaretskii wrote:
> > Date: Tue, 24 Aug 2004 15:09:12 -0400
> > From: Bob Rossi <bob@brasko.net>
> > Cc: gdb@sources.redhat.com
> > 
> > > Perhaps you could state what are the problems with `tty'?
> > 
> > O, you need to actually get a new tty.
> 
> Sorry, I still don't get it: I know what the `tty' command does, but I
> don't understand what is its problem on non-Unix platforms.  I don't
> see anything dubious in the code that implements the command.
> 
> > Windows doesn't have the concept of a tty.
> 
> Of course, it does.
> 
> > File descriptor redirection is fine.
> 
> And that's exactly what win32-nat.c does, please take a look.
> 
> > Maybe we could have something like
> > 
> >    gdb --i=mi --out_fd=n
> > where n is the descriptor you plan on reading from GDB.
> 
> How is this different from what GDB already does?
> 
> > What does it mean to open a 'tty' on a windows platform, or some other
> > non-unix platform?
> 
> Again, see win32-nat.c (search for "inferior_io_terminal").
> 
> I'm afraid I'm missing something.

OK, lately I have been making assertions when I probably should be
asking questions. Shame on me.

I understand on Unix, the client can open a tty, and direct the output of the inferior to it.
On windows, how would the client do that?

Does native windows actually support opening a 'tty'? Something I didn't
know.

Finally, using cygwin windows, do I use the tty option as if I was on
UNIX?

Thanks,
Bob Rossi

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: separating gdb & inferior output
  2004-08-25 11:41       ` Bob Rossi
@ 2004-08-25 18:34         ` Eli Zaretskii
  2004-08-30 19:23         ` Christopher Faylor
  1 sibling, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2004-08-25 18:34 UTC (permalink / raw)
  To: Bob Rossi; +Cc: gdb

> Date: Wed, 25 Aug 2004 07:41:01 -0400
> From: Bob Rossi <bob@brasko.net>
> 
> I understand on Unix, the client can open a tty, and direct the output of the inferior to it.
> On windows, how would the client do that?

The same way, essentially.  Windows has a similar device, and any
Posix-compliant environment (such as Cygwin) converts operations on
"/dev/tty" into operations on the Windows console device.

> Finally, using cygwin windows, do I use the tty option as if I was on
> UNIX?

Yes.

But I don't have a Cygwin install to test this, so I'll let it to
Chris to give definitive answers to your questions.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: separating gdb & inferior output
  2004-08-25 11:41       ` Bob Rossi
  2004-08-25 18:34         ` Eli Zaretskii
@ 2004-08-30 19:23         ` Christopher Faylor
  1 sibling, 0 replies; 7+ messages in thread
From: Christopher Faylor @ 2004-08-30 19:23 UTC (permalink / raw)
  To: gdb; +Cc: Eli Zaretskii

On Wed, Aug 25, 2004 at 07:41:01AM -0400, Bob Rossi wrote:
>Finally, using cygwin windows, do I use the tty option as if I was on
>UNIX?

Did you try looking in the source files that Eli suggested?

Yes, cygwin supports the concept of ttys.  It would be a pretty
limited implementation if it didn't.

cgf

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-08-30 19:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-24 16:12 separating gdb & inferior output Bob Rossi
2004-08-24 19:05 ` Eli Zaretskii
2004-08-24 19:09   ` Bob Rossi
2004-08-25  4:07     ` Eli Zaretskii
2004-08-25 11:41       ` Bob Rossi
2004-08-25 18:34         ` Eli Zaretskii
2004-08-30 19:23         ` Christopher Faylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).