Mail Archives: djgpp-workers/2004/12/04/07:54:36
> Date: Fri, 3 Dec 2004 13:28:59 -0500
> From: DJ Delorie <dj AT delorie DOT com>
>
> > When I asked about such a feature on a GDB mailing list, the response
> > was that people who need this use the `script' command available on
> > Unix, and that therefore such a feature is not something GDB users
> > miss. Unfortunately, the DOS port of `script' does not catch screen
> > I/O variant used by the DJGPP emulation of termios, so redirection is
> > currently the only option I know of for DJGPP users.
>
> Any reason why we can't teach redir to do the right thing for this
> purpose?
You mean, make `redir' be a replacement for `script'? That's a bit
tricky, since `script' needs to allow the normal screen I/O to
continue working as if redirection never happened. By contrast,
`redir' works by redirecting the handle, and then lets the program run
as usual, i.e. it doesn't duplicate the I/O, just redirects it.
The DOS port of `script' that I use implements what the Unix command
does by catching Int 21h functions that write the console device, and
then copies the string passed to Int 21h to the file, and lets the
original interrupt handler continue its normal processing.
The problem with our termios emulation is that it uses Int 29h to
write screen output and Int 16h to read screen input, and the ported
`script' doesn't catch those. (IIRC, it's not easy to catch these
interrupts with a DPMI program, but I forget the reasons.)
- Raw text -