Re: building gdb with TUI support on Windows

Ofir Cohen
2014-12-29T15:28:37Z

Hi Hannes,
Thanks again for the reply =].

> You are aware that with the arrow keys in TUI mode you move in the source
window, and not in the history?

Yes, ofc, I'm therefore moving the window focus from source to the
interpreter's CLI window (Ctrl+x, o),
and only then issue the arrow up/down/left/right commands.
Unfortunately, it doesn't work, I have to get out of TUI mode (Ctrl+x,
a), to make the arrow keys respond.

On Linux, when you do the above mentioned steps, it works flawlessly.

A shallow investigation, debugging of gdb with gdb, showed that
wgetch() function (deep in the call-stack, invoked indirectly by
stdin_event_handler), is blocking and doesn't return when the
arrow-keys are issued.

When gdb is not in TUI mode, however, getch() is called instead,
returns promptly and issues
the associated dispatch handler.

I'm interested in knowing how does it work for you,
and/or comparing the Linux flow (step-by-step debugging of gdb) with
the Windows's one.

Thanks,
Ofir Cohen

On 29 December 2014 at 02:41, Hannes Domani <ssbssa@yahoo.de> wrote:
> Ofir Cohen <ofircohenn@gmail.com> schrieb am 0:34 Montag, 29.Dezember 2014:
>> Hi Hannes,
>> I followed your advice, but I get compilation errors.
>>
>> 1) build pdcurses (with patched tputs)
>> a. copy term.h/curses.h to /mingw64/include and /mingw64/include/ncurses
>> b. copy libncurses.a to /mingw64/lib/
>> 1) cd gdb-7.8
>> 2) mkdir build; cd build
>> 3) .././configure --enable-tui --with-expat --build=x86_64-w64-mingw32
>> 4) make
>> 5) from DOS:
>> a) set PATH=c:\msys64\mingw64\bin\;%PATH%
>> b) d:\gdb-7.8\build\gdb\gdb --tui
>>
>> and even tried more to force use the ncurses termcap with:
>> .././configure --enable-tui --with-curses --with-expat
>> --build=x86_64-w64-mingw32
>>
>> But on TUI mode, the left/right/up arrows still don't work.
>> Neither does the CTRL+R (history lookup).
>
> So you had some compilation errors which you fixed yourself?
>
>> Though when you quit TUI mode (CTRL +x, a), the arrows start functioning,
>> and then when you go back to TUI mode (same keys combination), they don't work.
>>
>> Do the arrow keys work for you when you're in TUI mode?
>> What do you think is the problem?
>>
>> Note: the samples that come with pdcurses work, and the arrow keys
>> function there.
>> So it seems to be a gdb per se problem, and not some lack of support
>> from the library.
>
> I just retried CTRL+R and the arrow keys in TUI and normal mode, all works.
> You are aware that with the arrow keys in TUI mode you move in the source
> window, and not in the history?
>
> But I can't explain why CTRL+R doesn't work for you.
> Does it work in normal mode?
>
> My build uses libiconv as well (to display unicode strings), but I don't think
> this makes any difference for this case.