Re: [PATCH 20/24] Allow TUI windows in Python

Simon Marchi
2020-03-10T22:23:50Z

On 2020-01-04 1:34 p.m., Tom Tromey wrote:
> This patch adds support for writing new TUI windows in Python.
>
> 2020-01-04 Tom Tromey <tom@tromey.com>
>
> * NEWS: Add entry for gdb.register_window_type.
> * tui/tui-layout.h (window_factory): New typedef.
> (tui_register_window): Declare.
> * tui/tui-layout.c (saved_tui_windows): New global.
> (tui_apply_current_layout): Use it.
> (tui_register_window): New function.
> * python/python.c (do_start_initialization): Call
> gdbpy_initialize_tui.
> (python_GdbMethods): Add "register_window_type" function.
> * python/python-internal.h (gdbpy_register_tui_window)
> (gdbpy_initialize_tui): Declare.
> * python/py-tui.c: New file.
> * Makefile.in (SUBDIR_PYTHON_SRCS): Add py-tui.c.
>
> gdb/doc/ChangeLog
> 2020-01-04 Tom Tromey <tom@tromey.com>
>
> * python.texi (Python API): Add menu item.
> (TUI Windows In Python): New node.
>
> gdb/testsuite/ChangeLog
> 2020-01-04 Tom Tromey <tom@tromey.com>
>
> * gdb.python/tui-window.exp: New file.
> * gdb.python/tui-window.py: New file.
>
> Change-Id: I85fbfb923a1840450a00a7dce113a05d7f048baa

Hi Tom,

On a system without ncurses installed, I get:

$ make
CXX python/py-tui.o
In file included from /home/smarchi/src/binutils-gdb/gdb/python/py-tui.c:24:
/home/smarchi/src/binutils-gdb/gdb/gdb_curses.h:47:10: fatal error: ncurses.h: No such file or directory
47 | #include <ncurses.h>
| ^~~~~~~~~~~

So I suspect weare missing an #if/#ifdef somwhere. config.log contains:

/* Define to 1 if you have the <ncursesw/ncurses.h> header file. */
/* #undef HAVE_NCURSESW_NCURSES_H */

/* Define to 1 if you have the <ncurses.h> header file. */
/* #undef HAVE_NCURSES_H */

/* Define to 1 if you have the <ncurses/ncurses.h> header file. */
/* #undef HAVE_NCURSES_NCURSES_H */

Simon