From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 78B3F385C019 for ; Wed, 11 Mar 2020 05:07:09 +0000 (GMT) Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id E88D71E4A5; Wed, 11 Mar 2020 01:07:08 -0400 (EDT) Subject: Re: [PATCH 20/24] Allow TUI windows in Python From: Simon Marchi To: Tom Tromey Cc: gdb-patches@sourceware.org References: <20200104183410.17114-1-tom@tromey.com> <20200104183410.17114-21-tom@tromey.com> <4f60dcb3-1d6c-8660-12e0-fceea911bc10@simark.ca> <87zhcn68om.fsf@tromey.com> <8864df4e-a5fa-9c67-29c3-1a25887d0fce@simark.ca> Message-ID: Date: Wed, 11 Mar 2020 01:07:08 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <8864df4e-a5fa-9c67-29c3-1a25887d0fce@simark.ca> Content-Type: text/plain; charset=utf-8 Content-Language: en-US-large Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2020 05:07:10 -0000 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