This is the mail archive of the
mailing list for the GDB project.
Re: Enabled TUI mode on MSYS2
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Giah de Barag <gdb at crelg dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 14 Sep 2016 05:42:38 +0300
- Subject: Re: Enabled TUI mode on MSYS2
- Authentication-results: sourceware.org; auth=none
- References: <1E55DA7D-4F01-49BB-99FF-5A79933415A4@crelg.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> From: Giah de Barag <email@example.com>
> Date: Tue, 13 Sep 2016 17:20:52 -0400
> Here is a patch and a build recipe for GDB on MSYS2 to enable TUI mode.
I don't think there's a need for any patches, I regularly build GDB
for Windows with TUI support. See the binaries on the ezwinports
site. All that's needed is to specify TUI support at configure time.
> Eli Zaretski (https://www.sourceware.org/ml/gdb/2014-12/msg00039.html)
> comments that he had to “hide libncurses from the configure script in order to
> build a working debugger.” This comment might be dated.
Yes, it is. The issues that caused me do that were fixed long ago.
> GDB with TUI mode works fine on MSYS2 with curses, with this small patch. I saw
> that getch() (which becomes the ncurses getch() when you link in ncurses) in
> input.c returns EOF as soon as you hit any character. Fortunately, Windows
> conio has deprecated getch() and has defined _getch() in its place. So I
> changed it to _getch(), to access the conio version.
I submitted such a patch to the Readline maintainer many moons ago,
and the patch is already in the Readline sources. The problem is that
GDB uses its own copy of an old Readline, and all my requests to
import a new version of Readline failed. Until GDB does importa a new
version of Readline, this (and other) patches I submitted for Readline
will not be in GDB.
> There is a tiny issue now that with this conio _getch(), gdb does not properly
> process backspace characters.
I see no such problems in my binaries.
> Someone with understanding of event handling by gdb, Windows conio, and UNIX
> curses: Can you please look where there is “getch()” in rl_getc() in input.c
> and see why it returns EOF no matter what (when linking with ncurses).
That's what ncurses' getch does. It's not a bug. GDB simply should
not use that function in the MinGW build.