This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 24/25] Add new command to create extra console/mi UI channels
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 26 May 2016 18:46:15 +0300
- Subject: Re: [PATCH v2 24/25] Add new command to create extra console/mi UI channels
- Authentication-results: sourceware.org; auth=none
- References: <1458573675-15478-1-git-send-email-palves at redhat dot com> <1458573675-15478-25-git-send-email-palves at redhat dot com> <83twjz6bex dot fsf at gnu dot org> <56F02689 dot 2050503 at redhat dot com> <83r3f369io dot fsf at gnu dot org> <56F035F3 dot 6060702 at redhat dot com> <3f622c77-762a-c86e-cafb-60f75a598d6c at redhat dot com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Cc: gdb-patches@sourceware.org
> From: Pedro Alves <palves@redhat.com>
> Date: Thu, 26 May 2016 12:43:01 +0100
>
> I've been thinking a bit on how to make this all work on Windows,
> with Eclipse, and my current thinking is that instead of some hack to
> embed a native console window inside the GUI, better would be to reuse
> the same Eclipse terminal emulator widget, and coax gdb
> to send the right terminal escape sequences for cursor movement
> and character placement as a Unix gdb would.
Sorry, I know nothing about this "Eclipse terminal emulator widget".
In any case, this is Eclipse-specific, right?
> So in the end, GDB would be running with input/output connected to a
> named pipe, and we'd need to force gdb and ncurses to believe that
> that is a terminal.
I'm quite sure this would be a lot of work.
> I'm aware that GNU ncurses, has a concept of "drivers", and it
> has a driver for real windows consoles ("win32con") and that is
> the default. AFAIK, the way to select the driver is to set
> the TERM env var.
To select a different driver? Yes, the default is only used if TERM
is unset.
> The problems will probably be around isatty checks in
> readline and ncurses, as you suggested.
>
> There may also be #ifdef WIN32 bits in those libraries that
> are #ifdef-ing out code that we'll need, assuming terminal == console,
> though I haven't really checked.
Right.
> The isatty problem looks very much like the problem a native Windows/mingw
> program has when run on a Cygwin terminal (and MSYS/MSYS2, which are
> Cygwin forks), since Cygwin emulates pseudo terminals via named pipes.
> See, e.g.,:
>
> http://www.spinics.net/lists/git/msg274348.html
Cygwin also owns the libc it uses, so it's easy to work around the
related problems. MinGW cannot do that easily.
> BTW, while investigating this, I found that since some recent
> update to Windows 10, Windows consoles now supports ansi/vt100
> escape sequences, finally:
>
> http://www.nivot.org/blog/post/2016/02/04/Windows-10-TH2-%28v1511%29-Console-Host-Enhancements
>
> This further reinforces to me the idea of using ansi escapes on
> Windows Eclipse/gdb too.
Not sure how that is related, since the emulator is not a console for
the program that runs on it.