[PATCH 20/24] Allow TUI windows in Python

Simon Marchi simark@simark.ca
Wed Mar 11 05:07:08 GMT 2020


On 2020-03-11 12:47 a.m., Simon Marchi wrote:
> Sorry for being terse earlier, I didn't have much time.  I took another look,
> I built the file with -save-temps and inspected the .ii file.  The
> HAVE_NCURSES_H comes from pyconfig.h, which comes from the Python installation.
> 
> For example, on my Ubuntu here, it's at:
> 
>   /usr/include/x86_64-linux-gnu/python3.8/pyconfig.h
> 
> This file tells us Python was built with ncurses, which doesn't mean the
> ncurses development headers are installed and available to GDB.  I find it
> very odd that Python exposes these very generically-named macros in the global
> namespace.  Almost any of these HAVE_FOO macros from Python could clash with
> our own macros.
> 
> Anyway, I was able to reproduce it starting from a scratch Ubuntu 20.04 docker
> container, installing everything required to build GDB except the ncurses
> development headers.
> 
> One way to fix it is to make sure "python-internal.h" is included after
> "gdb_curses.h", in py-tui.c.

Or, maybe we can say that this falls in the "mis-configuration" bucket.

If we are building against a Python that claims to have been built with
ncurses.h present, then ncurses.h ought to be present.  Then the fix is
for the user to install the ncurses development package.

Simon


More information about the Gdb-patches mailing list