delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/22/03:19:58

Date: Mon, 22 Dec 1997 10:17:39 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "M. Schulter" <mschulter AT value DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: An IDE for UNIX
In-Reply-To: <67ker3$1v9$1@vnetnews.value.net>
Message-ID: <Pine.SUN.3.91.971222101723.10387I-100000@is>
MIME-Version: 1.0

On 22 Dec 1997, M. Schulter wrote:

> Maybe Eli might have some comments here, and the question seems relevant
> at least in emphasizing the different between MS-DOS limitations and
> limitations of Emacs/gcc/gdb themselves.

There's nothing mysterious here.  Emacs uses certain library functions
like `pipe' and `fork' to run GDB as a child process and establish a
pipe through which it communicates with GDB.  When you move a cursor
or type a command in the Emacs buffer that shows the source being
debugged, Emacs translates that to a GDB command and sends it down the
pipe.  GDB's input is redirected to the other end of that pipe, so it
reads the command, executes it and outputs the results.  The output of
GDB is redirected to another pipe which Emacs reads and does whatever
is appropriate.  For example, if GDB prints a source line, Emacs moves
the cursor to that line; if GDB prints a value of a variable, Emacs
shows that in a special window; etc.

We don't need too much to make this work on DOS.  One thing we need is
a way to preempt a child program to gain control of the CPU, and a way
to return control to the child.  This feature doesn't have to be true
multi-programming; Emacs debug support will work even if the child
program is only preempted when it reads its stdin or writes its
stdout.  After all, there's no need for GDB to get CPU time while it
is waiting for input from Emacs, and Emacs doesn't really need to do
anything while the GDB runs the debuggee.

Another feature that is needed is a way to catch output of a child
program and a way to feed it with input so that the pipe functionality
could be implemented.  This is quite simple to do for a child that is
a DJGPP program, but that means that only DJGPP programs could be used
in that way.

Given the above two features, it's a relatively simple matter of
making the Emacs asynchronous subprocess support work on DOS.  When
implemented, this support will immediately make integrated GDB,
integrated spelling and other niceties work on MS-DOS.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019