This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Enabled TUI mode on MSYS2

> From: Eli Zaretskii <>
> Date: Sep 13, 2016, at 22:42
>> From: Giah de Barag <>
>> 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.

Question below refers to this statement.

>> Eli Zaretski (
>> 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.

I do not understand the apparent conflict between this statement, that “GDB simply should not use that function in the MinGW build,” and the statement above, “I don't think there's a need for any patches.” How should one not use that function without affecting the source? Has this patch (changing getch to _getch) already been applied somewhere other than 7.11 (where I happen to be focused)?

> Thanks.

Thank you.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]