This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Emacs and GDB
- From: Eli Zaretskii <eliz at is dot elta dot co dot il>
- To: Jim Blandy <jimb at redhat dot com>
- Cc: a2782 at dis dot ulpgc dot es, gdb at sources dot redhat dot com
- Date: Sun, 24 Nov 2002 07:55:09 +0200 (IST)
- Subject: Re: Emacs and GDB
On 23 Nov 2002, Jim Blandy wrote:
> > Why not do what Emacs does: create a pipe for communications between
> > GDB and your program, then fork/exec GDB and redirect its standard
> > streams to the pipe using dup2/dup system calls?
>
> Actually, Emacs creates a pseudo-tty, and runs GDB there.
Actually, Emacs does both: it uses pseudo-ttys where available, or
creates a pipe where they aren't. (More accurately, there's also a third
method, via a socket.)
The source file process.c in the Emacs distribution has the gory details.