Discussion:
[Bug tui/17774] New: gdb on Windows TUI mode: arrow keys do not work
ofircohenn at gmail dot com
2014-12-30 18:08:54 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=17774

Bug ID: 17774
Summary: gdb on Windows TUI mode: arrow keys do not work
Product: gdb
Version: 7.8
Status: NEW
Severity: normal
Priority: P2
Component: tui
Assignee: unassigned at sourceware dot org
Reporter: ofircohenn at gmail dot com

Hi,
I'm building gdb on Windows with TUI support (--enable-tui) using msys2 with
MinGWx64, and the arrow keys do not respond when in TUI mode.

========
Scenario
========
1) Start gdb --tui (from DOS, with MinGWx64 bin dir in the PATH)
2) Move focus to gdb's CLI window (Ctrl+x, o)
2) Type any command (do not press Enter yet)
3) Click on the left/right keyboard arrow keys

Expected: text cursor will move to the left/right
Actual: nothing happens.

Moreover, the up/down keys (history lookup), do not respond either.

On Linux, OTOH, it works and the arrow keys respond (Ubuntu 12.04 with sudo
apt-get install gdb).


====================
Debugging the issue
====================
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 have a mailing list thread at "gdb at sourceware dot org":
http://comments.gmane.org/gmane.comp.gdb.devel/35208

This is as far as I could get.


=======================
More interesting facts
=======================
1) When you exit TUI mode (Ctrl+x, a), the arrow keys
function just fine and everything works.
2) Ctrl+p works (but up arrow key doesn't)
3) Ctrl+b/Ctrl+f work (but left/right arrow keys do not)
4) Ctrl+d works (but delete doesn't).



==========
Resources
==========
1) msys2 + MinGWx64
2) PDCurses (instead of ncurses)
3) .././configure --enable-tui --with-expat --build=x86_64-w64-mingw32; make
4) set PATH=C:\msys64\mingw64\bin; gdb --tui

Thanks,
Ofir
--
You are receiving this mail because:
You are on the CC list for the bug.
ofircohenn at gmail dot com
2014-12-30 18:10:22 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=17774

Ofir <ofircohenn at gmail dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Target| |x86_64-w64-mingw32
CC| |ofircohenn at gmail dot com
Host| |x86_64-w64-mingw32
Build| |x86_64-w64-mingw32
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-09-02 23:19:35 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=17774

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |WAITING
CC| |tromey at sourceware dot org

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
gdb is really at the mercy of the curses implementation here.
So, I would suggest contacting the PDCurses maintainers.
If there's something gdb is doing incorrectly here, then we could
address that; but first we'd have to know what it is.
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...