Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 20/24] Allow TUI windows in Python
Date: Wed, 11 Mar 2020 00:47:51 -0400	[thread overview]
Message-ID: <8864df4e-a5fa-9c67-29c3-1a25887d0fce@simark.ca> (raw)
In-Reply-To: <87zhcn68om.fsf@tromey.com>

On 2020-03-10 8:23 p.m., Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:
> 
> Simon> In file included from /home/smarchi/src/binutils-gdb/gdb/python/py-tui.c:24:
> Simon> /home/smarchi/src/binutils-gdb/gdb/gdb_curses.h:47:10: fatal error: ncurses.h: No such file or directory
> Simon>    47 | #include <ncurses.h>
> Simon>       |          ^~~~~~~~~~~
> 
> Simon> So I suspect weare missing an #if/#ifdef somwhere.  config.log contains:
> 
> Simon> /* Define to 1 if you have the <ncursesw/ncurses.h> header file. */
> Simon> /* #undef HAVE_NCURSESW_NCURSES_H */
> 
> Simon> /* Define to 1 if you have the <ncurses.h> header file. */
> Simon> /* #undef HAVE_NCURSES_H */
> 
> Simon> /* Define to 1 if you have the <ncurses/ncurses.h> header file. */
> Simon> /* #undef HAVE_NCURSES_NCURSES_H */
> 
> That is weird because gdb_curses.h says (I marked line 47):
> 
>         #if defined (HAVE_NCURSESW_NCURSES_H)
>         #include <ncursesw/ncurses.h>
>         #elif defined (HAVE_NCURSES_NCURSES_H)
>         #include <ncurses/ncurses.h>
>         #elif defined (HAVE_NCURSES_H)
> --->    #include <ncurses.h>
>         #elif defined (HAVE_CURSESX_H)
>         #include <cursesX.h>
>         #elif defined (HAVE_CURSES_H)
>         #include <curses.h>
>         #endif
> 
> ... which sure looks like it is guarded by HAVE_NCURSES_H.
> 
> I couldn't find any other code that might define HAVE_NCURSES_H.
> 
> I don't know what's going on here :(
> 
> Tom
> 

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.

Simon


  reply	other threads:[~2020-03-11  4:47 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-04 18:34 [PATCH 00/24] Horizontal TUI layout + " Tom Tromey
2020-01-04 18:34 ` [PATCH 21/24] Make some tui_source_window_base members "protected" Tom Tromey
2020-01-04 18:34 ` [PATCH 07/24] Remove hard-coded TUI layouts Tom Tromey
2020-01-04 18:34 ` [PATCH 01/24] Use TUI_DISASM_WIN instead of tui_win_list array Tom Tromey
2020-01-04 18:34 ` [PATCH 09/24] Allow TUI sub-layouts in "new-layout" command Tom Tromey
2020-01-04 18:34 ` [PATCH 02/24] Simplify tui_add_win_to_layout Tom Tromey
2020-01-04 18:34 ` [PATCH 12/24] Change TUI window iteration Tom Tromey
2020-01-04 18:34 ` [PATCH 19/24] Remove the TUI annotation hack Tom Tromey
2020-01-04 18:34 ` [PATCH 15/24] Remove tui_delete_invisible_windows and tui_make_all_invisible Tom Tromey
2020-01-04 18:34 ` [PATCH 11/24] Add horizontal splitting to TUI layout Tom Tromey
2020-01-04 18:47   ` Eli Zaretskii
2020-01-04 18:34 ` [PATCH 06/24] Reimplement "tui reg" command Tom Tromey
2020-01-04 18:34 ` [PATCH 10/24] Change return type of tui_layout_base::adjust_size Tom Tromey
2020-01-04 18:34 ` [PATCH 04/24] Simplify TUI C-x 2 binding Tom Tromey
2020-01-04 18:34 ` [PATCH 20/24] Allow TUI windows in Python Tom Tromey
2020-01-04 18:57   ` Eli Zaretskii
2020-02-22 19:57     ` Tom Tromey
2020-02-22 20:18       ` Eli Zaretskii
2020-03-10 22:23   ` Simon Marchi
2020-03-11  0:23     ` Tom Tromey
2020-03-11  4:47       ` Simon Marchi [this message]
2020-03-11  5:07         ` Simon Marchi
2020-03-11 18:05         ` Tom Tromey
2020-01-04 18:34 ` [PATCH 03/24] Fix latent display bug in tui_data_window Tom Tromey
2020-01-04 18:34 ` [PATCH 16/24] TUI windows do not need to store their type Tom Tromey
2020-01-04 18:34 ` [PATCH 13/24] Reimplement tui_next_win and tui_prev_win Tom Tromey
2020-01-04 18:34 ` [PATCH 05/24] Reimplement TUI "C-x 1" binding Tom Tromey
2020-01-04 18:34 ` [PATCH 18/24] Remove tui_set_win_focus_to Tom Tromey
2020-01-04 18:34 ` [PATCH 24/24] Fix cast in TUI_DISASM_WIN Tom Tromey
2020-01-04 18:34 ` [PATCH 08/24] Add the "tui new-layout" command Tom Tromey
2020-01-04 18:44   ` Eli Zaretskii
2020-01-04 18:34 ` [PATCH 22/24] Use error_no_arg in TUI Tom Tromey
2020-01-04 18:34 ` [PATCH 14/24] Handle ambiguity in tui_partial_win_by_name Tom Tromey
2020-01-04 18:34 ` [PATCH 23/24] Add "usage" text to all TUI command help Tom Tromey
2020-01-04 18:54 ` [PATCH 17/24] Change how TUI windows are instantiated Tom Tromey
2020-02-22 20:22 ` [PATCH 00/24] Horizontal TUI layout + windows in Python Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8864df4e-a5fa-9c67-29c3-1a25887d0fce@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox